I am unable to get subscription price after updating google play billing library from v4 to v5. Billing flow is working perfectly and I am also able to purchase the product.
I was able to get prices of subscription products on v4.
I've tried this but I am not getting price.
if (billingClient.isReady()) {
QueryProductDetailsParams queryProductDetailsParams =
QueryProductDetailsParams.newBuilder()
.setProductList(
ImmutableList.of(
QueryProductDetailsParams.Product.newBuilder()
.setProductId(ITEM_SKU_SUBSCRIBE)
.setProductType(BillingClient.ProductType.SUBS)
.build())).build();
billingClient.queryProductDetailsAsync(queryProductDetailsParams, new
ProductDetailsResponseListener() {
@Override
public void onProductDetailsResponse(@NonNull BillingResult billingResult, @NonNull List<ProductDetails> list) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
monthlyPriceTV.setText(list.get(0).getSubscriptionOfferDetails().get(0).getPricingPhases().getPricingPhaseList().get(0).getFormattedPrice());
}
});
}
I am not getting any errors or warnings
Any help will be really appreciated