I have an issue with premium base plan subscriptions, and I’m hoping that it’s just because it takes a long time to sync the changes or something like that.
monthlyButton.setOnClickListener {
billingManager.initiatePurchase(requireActivity(), "premium-1")
}
biannualButton.setOnClickListener {
billingManager.initiatePurchase(requireActivity(), "premium-2")
}
annualButton.setOnClickListener {
billingManager.initiatePurchase(requireActivity(), "premium-3")
}
Premium 1, 2 and 3 was just set up yesterday, 16 hours ago, but they still don’t work (When I click the button, there is no popup for payment by Google Play). However, a premium subscription base plan I created a week ago works. I’m wondering if there is anything I can do about this. These base plans are all for the same subscription.
private fun queryProductDetails(productId: String) {
val queryProductDetailsParams = QueryProductDetailsParams.newBuilder()
.setProductList(
ImmutableList.of(
QueryProductDetailsParams.Product.newBuilder()
.setProductId(productId)
.setProductType(BillingClient.ProductType.SUBS) // Specify SUBS for subscriptions
.build()
)
)
.build()
billingClient.queryProductDetailsAsync(queryProductDetailsParams) { billingResult, productDetailsList ->
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
Log.d(TAG, "Product details queried successfully")
if (productDetailsList.isNotEmpty()) {
Log.d(TAG, "Product Details: ${productDetailsList[0]}")
initiatePurchase(productDetailsList[0])
} else {
Log.e(TAG, "No products found")
}
} else {
Log.e(TAG, "Error querying product details: ${billingResult.debugMessage}")
}
}
}
My billing manager code will output no products found each time I click on either premium 1, 2 or 3.
I set the statuses of all base plans to active and have published the app for internal testing. Only “premium” plan (Base plan I activated last week) works and provides correct popup and allows me to subscribe.