I have added in app purchases to a game and they work fine, until you press the home button while you're making an in-app purchase. The application needs to be in singleTask mode (it is a Unity project).
So, taking google's sample project from the documentation, it all works fine. Add
launcandroid:launchMode="singleTask"
and then it has issues when pressing the home button during in app purchases, as follows:
- if you press the purchase button, and then it takes you to google play's buy screen saying "this is a test order, you will not be charged", and you press home here, when loading the app again it says:
Error purchasing: labResult: Null data in IAB result (response: -1002:Bad response received)
- if you go through with the purchase, until it says "purchase successful", and press the home button there, you will get the same error, you don't get the in app product in-game, and the next time you try purchasing it says
Error purchasing: labResult: Unable to buy item (response: 7:Item Already Owned)
So obviously it does not get consumed (until the next time the application is launched):
How are you guys handling these kinds of issues? Or are you handling them at all?