5
votes

enter image description here I'm now developing a small game with Google's in-app billing service.

And I reference to Trivial Drive of Google's sample project. Let's me ask you about connection interruption during Purchase Items from Google Play.

It's OK when launching purchase flow with normal internet connection.

I tested like this. As soon as purchase flow is launched, disconnect the internet connection (by unplugging the routers' LAN). After about 2-3 minutes, It shows Connection time out. In merchant account, Money transfer is done. But when I query All owned items, there is no owned item of this ID (purchased recently). And when I try to purchase again this item, It shows "Error You already owned this item".

enter image description here

How can I solve this problem? Anybody encountered like this problem?

Please Help. Appreciate to all comments and helps. Thanks.

1
I don't think the Google merchant and Play account will be completely out of sync on Google's side; if this were the case it would be widely known. What does happen, though, is that the GP IAB V3 Service uses local caching, such that your app needs to be robust in this regard. -- Unfortunately, what you describe is not a problem in itself, so unless you describe the specific issue you have in this regard, the only possible suggestion is to make your app robust with respect to this.class stacker
Sorry for my improper way of Asking question. Thanks for your suggestion.John Nash
Im stuck with the same issue. I had a wifi connectivity issue which resulted in a timeout error, and now a "you already own this item" error. This is now resulting in the app crashing on start. Where can I go to clear the token from my Google account lol? (this seems like it should have a dashboard somewhere bc it happens a lot according to StackOverflow 0.o)NukeouT

1 Answers

1
votes

The Google IAP flows requires you to call a consumePurchase() API after doing a purchase.

What you need to do is to call the getPurchases() API, this will return a list of purchases along with a purchaseToken. Then you need to iterate through them and call the consumePurchase() API for the purchased, unconsumed products.

For more reference, look at the API reference.