question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Several issues since moving from IabHelper to billing library 1.1

See original GitHub issue

I 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.

purchase error

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:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
casolorzcommented, Dec 11, 2018

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 does queryPurchaseHistoryAsync but after that returns it uses queryPurchases again. While I have no idea if that helps, my hope was that the call to queryPurchaseHistoryAsync would refresh caches, if that is the issue.

0reactions
iso218commented, Jan 3, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Several issues since moving from IabHelper to billing library 1.1
I've managed to get some logs from a few of them, and it seems getPurchases and queryPurchaseHistoryAsync are returning an empty purchases list....
Read more >
PSA: Do not update Play Billing Library to 1.2.1 : r/androiddev
Just got a interesting chat with a Googler from that team, they acknowledge the issues, appreciated the feedback and the provided code and...
Read more >
Android IABHelper vs Billingclient - in app purchase
It seems google doesn't support IabHelper anymore. There are many issues in it. I hope google will fix issues and will update new...
Read more >
Google Play Billing Library release notes - Android Developers
Fixed a bug where debug messages were being returned as null in some cases. Fixed a potential memory leak issue. Google Play Billing...
Read more >
How to make In App Purchase in Android Using Google Play ...
First add Google Play Billing Library dependency at app level of your ... After releasing app in internal test go to Store presence ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found