- Home /
android: game restarts on google play purchase
I'm using the Prime31 in-app-billing plugin to sell consumables in an android game. On my test device (Motorola Defy XT), when I open the Google Play store to make the purchase (either real or test store), the android OS closes my game in the background to free up memory. Once the purchase is finished, the Play store passes control back to my game, the OS says "oh, the game isn't running, let me restart that for you" and restarts it, the game restarts, but the game never receives the purchase confirmation so the purchase never shows up in the game. The player has been charged for the purchase, but the purchase doesn't show up! THIS IS BAD.
At the suggestion of the Prime31 team, I created a new, super-low-memory scene, and tried moving the player to that new scene whenever they initiate a purchase and running the purchase from there. This makes the game return correctly and confirm the purchase correctly if the purchase is made in the TEST store, but using the REAL store the OS still closes the game.
Meanwhile, an identical build of the game, on the same device, which uses the Prime31 Amazon IAP plugin and Amazon's store for the purchase instead of the Google Play store, makes the purchase just fine without closing the game, and doesn't even need to be called from that minimal scene.
Any suggestions on how I can fix this? I thought that if I set autoConfirmPendingPurchases to false that Google Play would continue to send the purchase data to my app (even after a restart) until I called confirmPendingPurchases(), but that didn't work, and the Prime31 guys said that it was because Google Play can take as much as 24 hours between resends of purchase data (unless I misunderstood them), so that's not an option.
I was also considering trying to make the OS "foreground" my game like a music player while the purchase was processing, but I don't think there's any easy way to do that in Unity, and I'm hoping for a simpler solution before I give myself a crash course in android native code just to make that work.
Please help!
Any solution on this? I have the same problem but with own plugin for In-App-Billing v3.
Your answer
Follow this Question
Related Questions
Restore IAP in Android using Prime 31 1 Answer
In App Billing by Alipay, how to check if google services is not available 0 Answers
IAP game does not start on android 0 Answers
How to verify GooglePlay In App Billing receipt through Serverside 0 Answers
codeless IAP button not working on google playstore 1 Answer