Aldrin Joe Mathew
Aldrin Joe Mathew

Reputation: 139

Android Google billing integration - Client does not support ProductDetails

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?

Upvotes: 13

Views: 8104

Answers (6)

maxfloden
maxfloden

Reputation: 325

I got this same error when using the cordova-plugin-purchase v13.8.0 in an Ionic 7 / Angular 16 / Capacitor 5 project. Using com.android.billingclient:billing:5.2.1

I was running Google Play Store v35.2.19-21, but after upgrading Play Store to v37.4.24-21 it works. (How to update Google Play Store)

Upvotes: 1

Ideal Developer
Ideal Developer

Reputation: 21

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

Upvotes: 2

albert adam
albert adam

Reputation: 11

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

Upvotes: 1

em_
em_

Reputation: 2269

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.

Upvotes: 0

Linh
Linh

Reputation: 60923

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
    }

    ...
}

Upvotes: 5

Blue Ocean
Blue Ocean

Reputation: 443

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()
}

Upvotes: 2

Related Questions