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".
How can I solve this problem? Anybody encountered like this problem?
Please Help. Appreciate to all comments and helps. Thanks.
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.
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