We just launched our game on the Amazon Android Store with their new In-App Purchase SDK. We are seeing a few sale that resulting users not getting the virtual good they paid for. I've have reproduced one use case that will cause this to happen every time.

Basically the user initiates and IAP, they are taken to the Amazon purchase dialog, they make the purchase and they are given Amazon's purchase confirmation dialog.
If the user, clicks the Close button on the Dialog or the Back button on the Options Bar at the bottom of the screen (with a Kindle Fire), the dialog closes and the IAP process sends a message to the app the purchase has been a success. I get the message and process it, all is good.
However, if the user hits the "Home" button the purchase confirmation closes and the user gets dumped to the Home Screen, the app never receives the purchase Success message.

I'm trying to get some sort of work around since users are not going to care about the vagaries of message receipts in the Amazon's IAP implementation, they just care that they paid for something they didn't get. We've got 1 non-consumeable good which isn't a problem since our app checks for previous purchases on start up. But the consumable goods are another issue. You can't restore those.

Is there a workaround?

1

There are 1 answers

0
user4396478 On

There are actually 2 apps executing the purchase. The purchase is initiated by your app, but executed by the amazon IAP component in the device which is another app. If you press home button, that brings both the app to background and often due to android's aggressive memory management, the app goes into a dormant stage or even killed depending upon how much resource utilization is on the device. This causes the purchase to not reach your app.

Amazon has a workaround for it. As documented here - https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/implementing-iap-2.0, implement the onPurchaseUpdateResponse(), which will fetch the pending purchase whenever the app is re launched. There is a small time delay that prevents immediate "fetch pending purchases".

Also ensure that you call notifyFullfilment() after the item has been fulfilled to the user. Not doing this will still cause your app to work; but it may negatively impact your monetization (there are different reasons for it, which I am not going into details).