Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error refreshing iventory (querying prices of items). (response: 6:Error)

Tags:

android

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.

like image 970
Cheok Yan Cheng Avatar asked Jun 17 '13 18:06

Cheok Yan Cheng


2 Answers

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.

like image 117
slarbu Avatar answered Oct 13 '22 18:10

slarbu


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?

like image 23
Pointer Null Avatar answered Oct 13 '22 16:10

Pointer Null