2

I'm having a whole host of, what seem to be, very strange behaviors while integrating In-App Billing into a project for a client. I'm hoping someone can shed some light on what might be the root cause and what, if anything, I can do about them. So far several days of Googling (a lot of results bringing up stack overflow) and a bit of extra searching on here don't seem to quite be the same problems as ours, but do give some similar issues.

As a bit of background into what the purchase is, it is a purchase of a world/level pack for a simple puzzle game. We display a trolley to indicate that the item is purchasable, a spinning/loading icon to show there is a purchase in progress and we show the world information (levels complete in this world etc) when the purchase has been completed. When the spinner is displayed you cannot begin attempt to make the purchase (the button is disabled), but you can continue to play the available parts of the game normally.

This seems to work on a fair number of devices, including now a device of theirs which wasn't working when they loaned me to test with, after some minor changes to the code now works every time. To quickly list off the issues we seem to be having:

  1. Test User makes a successful purchase, they are shown the default Google Play Toast, but I don't receive a purchase succeeded message for up to 5 minutes (so far, our longest wait). The spinner is displayed the entire time.
  2. Same as above, but we get no response at all. Left the devices standing for well over an hour with no result. The spinner never goes away.
  3. Even more disconcerting, I'm told that one of my clients devices showed the behavior we expect to see when the purchase failed after being told it was successful. (i.e. The spinner is replaced with the trolley icon and not the level data). This only occurs when I receive a failed message back after making the purchase. I have not been provided with any logging information from this case however, so I cannot confirm it.
  4. Note: This particular error no longer occurs, but because of it I had to make a fair few changes to the code which I'd like to do away with if possible. After pressing "Accept & Buy" the user is shown a message saying "‘Error’ Your payment could not be processed at this time. You may receive an email asking you to verify your account’." When this error occurs I receive both a success AND a failure response.
  5. Exiting the purchase at a certain point before confirming payment causes no response to be received at all, the spinner never goes away. Again, I have no steps to reproduce it on my end as the description was rather vague and came with no logs.

Note that on about half of our test devices and test accounts, the purchase works perfectly fine. Usually the response is received and the product delivered within 30 seconds. Also note that Restore Transactions works as expected for all of these cases (1, 2 and 3 all return success responses and 4 returns nothing). Because of issues 2 and 3 I now flag the app to perform a restore transactions call the next time the app is launched after a purchase prompt has been launched, this seems to be a workaround but the issues occur far too often for this to be satisfactory.

For some quick technical specs I'm using Unity3D with the latest version of the Prime31 plugin. I believe these are not the problem as the logging information I have been given (usually in the case of issue 2) and my own collected logs show no information regarding a purchase state changed event, when usually there are several when a message is received. The first of which is logged by the device itself before being passed to the app.

I should be able to get a list of affected devices with some logs tomorrow when I visit my clients office. However I don't think it's device related as they have 2 ASUS Nexus 7's to test with, one of which has always worked and the second which still occasionally shows errors.

Can anyone shed some light on these issues? This is my first foray into In-App billing with Google Play and it hasn't been as simple as it first seemed.

Thanks

Kay
  • 12,918
  • 4
  • 55
  • 77
sinalta
  • 21
  • 2
  • 1 and 2 are known issues, so in my case I had to make a dialog (and add a button to close spinner manually) explaining that if purchase confirmation is not coming user should perform a restore transactions. – Sver Nov 28 '12 at 05:09
  • Issue 1 isn't a massive deal obviously, since it does respond eventually. We've worked around issue 2 by running a sanity check restore transactions call on the next launch, but that isn't ideal. I would have preferred a button to be added, but my client wants a text-less game and that's a hard button to figure out an icon for, so we've settled for the on-next-launch approach. – sinalta Nov 28 '12 at 18:33
  • To further elaborate on issue 3 though, the device is a Motorola Atrix and it's responding with both a success and failure message when the purchase is made. I'm processing this as a failure as it's the same behaviour as issue 3, which is a failed response. For now the workaround is the same as issue 2, but it a really confusing process for the user. – sinalta Nov 28 '12 at 18:37

0 Answers0