11

On trying to migrate Google billing integration from version 4 to 5, I'm getting an error 'Client does not support ProductDetails' on calling queryProductDetailsAsync.

List<QueryProductDetailsParams.Product> productList = List.of(QueryProductDetailsParams.Product.newBuilder()
            .setProductId("ppgapp1")
            .setProductType(BillingClient.ProductType.SUBS)
            .build());
QueryProductDetailsParams params = QueryProductDetailsParams.newBuilder()
                    .setProductList(productList)
                    .build();
billingClient.queryProductDetailsAsync(params, listener);

Are there any changes needed to be made on the console on migration?

And how long it'll take to complete review on submitting to closed or internal test track for Google billing integration?

5 Answers5

3

I face same issue when my emulator PlayStore application version is too old (in my case it is 23.0.21...)
Update PlayStore application to newer version will solve the problem (30.9.0...)

Here is how to update the Play Store app

If you want to guide user to update the PlayStore app, you can do like

billingClient.queryProductDetailsAsync(productParams) { billingResult, productDetails ->

    if (billingResult.responseCode == BillingClient.BillingResponseCode.FEATURE_NOT_SUPPORTED) {
        Log.e("TAG", "Feature not supported ")
        runOnUiThread {
            Toast.makeText(this@MainActivity, "Please update PlayStore app", Toast.LENGTH_LONG).show()
            // or AlertDialog or any error message
        }
        return@queryProductDetailsAsync
    }

    ...
}
Linh
  • 57,942
  • 23
  • 262
  • 279
  • @multibook hk I think update PlayStore app may help, please check it – Linh Jun 15 '22 at 12:33
  • 1
    Sound super risky. Ordinary user will have no idea how to upgrade Google Play store. – Cheok Yan Cheng Oct 06 '22 at 06:03
  • As per my testing, event my Google Play store is having version 32.5.14-21, I am not getting any callback during `BillingClient.queryProductDetailsAsync` – Cheok Yan Cheng Oct 06 '22 at 06:35
  • As a data point, I've seen reports of this from a Pixel 4a running Android 13 and the latest version of Google Play Services. Next up, I'll report the version of the Play Store app (as suggested here), to see if that's the issue. Regardless, this means Android 13, out of the box, is not supporting this feature. – Mark Dec 24 '22 at 04:14
  • 1
    Just had a report from a device (Galaxy A12, Android 11) running the latest versions of both Google Play Services (version code: `224814037`) and Google Play Store (version name: `33.5.17-21 [0] [PR] 493922335`) where the billing response code for `billingClient.isFeatureSupported(BillingClient.FeatureType.PRODUCT_DETAILS)` was `FEATURE_NOT_SUPPORTED`. How is this possible? – Mark Jan 01 '23 at 03:23
2

I had experienced the same problem. I couldn't find any information on why the problem is occurring. You can use it after checking whether the ProductDetail feature is supported.

BillingResult billingResult = billingClient.isFeatureSupported( BillingClient.FeatureType.PRODUCT_DETAILS );
if ( billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK ) {
    // use billingClient.queryProductDetailsAsync()
}
Blue Ocean
  • 208
  • 2
  • 8
1

Getting this error when I use google play version 21.2.12-21. When I use the 31.2.29-21 version of google play on another device, the item can be successfully queried. I can't use the 5.0 version of the billing library because it affects the user's payment

1

Issue resolved Issue was occuring on one device and not occuring on another device with latest library.

Upon debuging I used old library on device where issue was occuring. And it was working fine on old library.

So after alot of trouble shoot I do following to resolve issue on that device with latest library code.

On device where issue is occurred Do following

  1. Update device OS update if there is any. In my case there was security patch update. Notification was there to update.
  2. update play store if already not updated
  3. Then clear data storage of play store app under setting of play store app. Then force stop play store app and then open play store app
  4. uninstall and reinstall the android app again

After that my app shows product details as well as purchase pop up with latest billing library.

Thank you

0

I had to reinstall the app for the Billing client to recognize the supported product ID. I imagine that simply purged some stale cache behind the scenes.

em_
  • 2,134
  • 2
  • 24
  • 39