Several issues since moving from IabHelper to billing library 1.1
See original GitHub issueI just finished releasing my first version with the new billing library. My sales started dropping the day it was released, I’m now at about 10 to 15% less sales than before the release. I’m getting a lot more emails from users having issues with their purchases of my app. I’ve managed to get some logs from a few of them, and it seems getPurchases
and queryPurchaseHistoryAsync
are returning an empty purchases list.
My code is pretty simple. When the app starts I call:
billingClient = BillingClient.newBuilder(ac).setListener(new PurchasesUpdatedListener() {
@Override
public void onPurchasesUpdated(int responseCode, @Nullable List<Purchase> purchases) {
... handle purchase result
}
billingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(@BillingClient.BillingResponse int billingResponseCode) {
...call my query purchases method if connected.
}
myQueryPurchasesMethod(){
..... make sure the billing client is ready ....
..... check billingClient.queryPurchases ....
..... if billingClient.queryPurchases is null or purchase list is empty, call queryPurchaseHistoryAsync....
}
It is on the query of purchases that I can see on the logs from my users that there are no purchases. I have verified that their email addresses do have purchases. I have verified that the app is installed using that email. If they try to buy something else, the purchase dialog shows the right email. But still both ways of querying purchases return no purchases.
That is one of the issues, probably the main one.
Another issue reported by two users, they are told the item is not available. I only have 4 sku’s on my app, all of them are available, nothing has changed on that in over a year.
Aside from these errors, there seems to be a lot of disconnect or connection failures for the billing client. I don’t know if those are normal though.
Overall I think I’m going to have to revert back to using the old IabHelper code if I can’t get this solved soon.
Reading the documentation again I’m thinking I probably only need to call queryPurchases
and not call queryPurchaseHistoryAsync
but either way, I’m only calling the second one if the first one fails.
Anyone else having these issues?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top GitHub Comments
Most of my issues came from using
queryPurchaseHistoryAsync
because I didn’t read the documentation correctly.My current implementation uses
queryPurchases
and if that doesn’t work then it doesqueryPurchaseHistoryAsync
but after that returns it usesqueryPurchases
again. While I have no idea if that helps, my hope was that the call toqueryPurchaseHistoryAsync
would refresh caches, if that is the issue.Hi, my first project I looked at the device tests in the play console and I tested the firebase did not encounter such a problem. But if I take your solution, I will. I don’t know if the problem is caused by me. Have a nice day.