Questions tagged [play-billing-library]

Anything specific to Google Play Billing library

This tag was created to ask questions and report feedback specific to Google's Play Billing Library.

260 questions
37
votes
4 answers

queryPurchases() vs queryPurchaseHistoryAsync() in order to 'restore' functionality?

I'm using the Play Billing Library in order to trigger and manage purchases which in turn unlocked extra functionality within an app. This part is working. However, what is the best way to 'restore' purchases. Say for example someone who has bought…
laurie
  • 965
  • 1
  • 11
  • 21
26
votes
3 answers

Getting the ProductDetails price in android-billing-5.0

I have upgraded my Kotlin app to android-billing 5.0 from 4.0, and as such, SkuDetails is now deprecated so I am migrating to using ProductDetails using the migration instructions. Previously I displayed the purchase price for in-app purchases to…
Peter
  • 2,654
  • 2
  • 33
  • 44
24
votes
2 answers

BillingFlowParams.Builder setSkuDetails for testing static Google Play Billing responses

I'm testing in-app purchase using the three reserved product IDs for testing static Google Play Billing responses: android.test.purchased android.test.canceled android.test.item_unavailable However, setSku and setType seem to be deprecated in the…
Ping
  • 361
  • 1
  • 2
  • 5
22
votes
10 answers

Android Play Billing Library: onSkuDetailsResponse responseCode is 0, but the size of skuDetailsList is also 0

I'm now using the new Play Billing Library Basically, I followed the documentation to query available items to purchase SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder(); params.setSkusList(skuList).setType(itemType); …
21
votes
4 answers

How to pass token of a one time purchase product to Google Play Billing Library 5?

How do you get token of PurchaseDetails object in Android? Based on the docs, https://developer.android.com/google/play/billing/integrate#java, to launch a purchase flow we need to do something like below: // An activity reference from which the…
Mark
  • 3,138
  • 5
  • 19
  • 36
19
votes
0 answers

Google Play In-app Billing API version is less than 3 with updated Play Store

I'm using the Google Play Billing Library to offer some in-app purchases in my app. Everything is working correctly, but I'm receiving the error "Google Play In-app Billing API version is less than 3" on Crashlytics from some users, mainly using…
materight
  • 527
  • 8
  • 22
18
votes
4 answers

BillingClient always returns SERVICE_DISCONNECTED

So I have a billing client which I instantiate with billingClient = BillingClient.newBuilder(this).setListener(this).build(); I then call billingClient.startConnection(new BillingClientStateListener() { @Override public void…
1tSurge
  • 663
  • 2
  • 7
  • 20
17
votes
1 answer

Google Play Billing Library - querySkuDetailsAsync occasionally returns BillingResponseCode.ERROR (6)

I am using Google Play Billing Library 2.0.3 (implementation 'com.android.billingclient:billing:2.0.3') and it works fine for the most part, but for some users for the reasons unknown, querySkuDetailsAsync() method occasionally fails with…
16
votes
1 answer

Google Play Billing Library: Determine base plan / expiry of subscription purchase

I am using the Google Play Billing Library 5 and have a subscription product with different base plans. When processing the purchases in the PurchasesUpdatedListener or in the callback of queryPurchasesAsync, I receive a list of Purchase objects…
14
votes
0 answers

billingClient.queryPurchases returns the list with already cancelled subsription

Steps to reproduce (test account): Complete subscription process in the app Cancel subscription in Play Store app and wait till it ends to completion (for monthly test subscriptions 5 minutes for the date of writing) Expected: Subscription is no…
yaroslav
  • 863
  • 1
  • 8
  • 20
14
votes
0 answers

Play Billing Library - V3 vs Async vs Sync - different results

I have users that have purchased items (SkuType.INAPP) from my application. In the previously recommended implementation of in app billing the IabHelper.QueryInventoryFinishedListener would return an Inventory that contained no items that they…
13
votes
1 answer

How to find out if the user is eligible for Free Trial with Billing Library (in other words, he had not availed Free Trial before)?

How to find out if the user is eligible for Free Trial with Billing Library? In other words, how to find out that the user had not availed Free Trial before? I didn't find any API that would help to know this for sure. And this information is not…
Ksenia
  • 3,453
  • 7
  • 31
  • 63
13
votes
2 answers

Get active subscriptions In-app Billing Android

I have used the In-app billing library for adding subscriptions in my app. Everything is working properly but I am unable to find how do I get a Users current active subscription? As per the docs, the method queryPurchaseHistoryAsync returns the…
12
votes
2 answers

Android In-App Billing: Refunded in-app purchases not cancelled

I'm having a trouble with testing my in-app billing. (using Google Play In-app Billing Version 3 API) Problem: Refunded in-app purchases are still present in the purchase list, which is provided by BillingClient.queryPurchases(). When I tried…
11
votes
5 answers

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 productList =…
1
2 3
17 18