I'm facing exactly same problem as
In-app billing v3 unable to query items without network connection or in airplane/flight mode
It don't always occur. You need to switch your phone to airplane mode, or turn off wifi, wait for several hour, only the problem will occur. The following error message will be shown.
Failed to query iventory : IabResult: Error refreshing iventory (querying prices of items). (response: 6:Error)
Author suggested using
List<String> skulist = new ArrayList<String>();
skulist.add("my_sku_name1");
skulist.add("my_sku_name2");
mHelper.queryInventoryAsync(true, skulist, mGotInventoryListener);
to solve the problem.
However, it doesn't work for me. Same problem still occur.
Any workaround on this problem? Thanks.
As Jerry suggested in his comment, you can work around this by calling
mHelper.queryInventoryAsync(false, mGotInventoryListener);
instead of
mHelper.queryInventoryAsync(mGotInventoryListener);
I have disabled all network connectivity from my device (for over a day) and can reliably reproduce/fix the issue with that single parameter change. Looks like the purchase itself will be cached for longer (indefinitely?) by the in-app billing service than the sku details like price.
It looks like Google Play has expiration of cached inventory items. That may be implementation detail of how Google Play app works.
Error 6 is defined as BILLING_RESPONSE_RESULT_ERROR.
If it's critical for you to offer inventory for purchase even without Internet connection, you may need to cache last returned results yourself, and use them in case that querying fails.
However, purchasing also would not work in such scenario, so why to bother?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With