We’re experiencing a strange problem with the “already owned” consumables, and it doesn’t happen every time.
The first step is to cut off the internet connection between pressing buy, and seeing the next google popup - this should cause it to show the “no internet connection” message.
When we try and make the purchase again and see this message, the callback to lua has:
table: 0x7be9e488 { 02-09 17:23:19.215: I/Corona(13878): [name] =\> "storeTransaction" 02-09 17:23:19.215: I/Corona(13878): [transaction] =\> table: 0x7be9e488 { 02-09 17:23:19.215: I/Corona(13878): [state] =\> "failed" 02-09 17:23:19.215: I/Corona(13878): [errorString] =\> "User canceled. (response: -1005:User cancelled)" 02-09 17:23:19.215: I/Corona(13878): [isError] =\> true 02-09 17:23:19.215: I/Corona(13878): [errorType] =\> -1005 02-09 17:23:19.215: I/Corona(13878): } 02-09 17:23:19.215: I/Corona(13878): }
instead of error string saying:
Unable to buy item (response: 7:Item Already Owned)
It means we have no way of differentiating between when a user has genuinely cancelled a transaction, or if this has happened. We can’t make the assumption that this error has happened and grant them the items anyway, otherwise it would be really easy for user’s to exploit.
However there is a “solution” but we don’t understand why it is working. If we purchase a different consumable item successfully and then call restore, the original “owned” purchase that was stuck in limbo appears as expected in our restorable items. So then we can consume it and make it available for purchase again.
Any ideas what could be happening here?
Edit:
Just found this on stackoverflow: http://stackoverflow.com/a/26682883/1182532
It seems that the IABhelper java code will return error code -1005 instead of 7, it’s hardcoded to do that.
So now my question is: is that in fact still the case, or have Google fixed this and now the Corona plugin need to be updated? And also, why would making a second purchase suddenly add the first purchase to the restorable items data returned by Google?