question

Amazon Customer avatar image
Amazon Customer asked

Apps rejected for showing error dialog when user cancels IAP

Hi there, I've had some apps rejected because my app shows a "purchase failed" dialog box when the user cancels an in-app purchase. However, I don't see anyway I can detect this cancellation in code - it's pretty much just "success", "failure", "invalid_sku" or "already_entitled" as the possible responses in PurchaseResponse.PurchaseRequestStatus. My code just checks this state (in onPurchaseResponse()) and shows an error on "failure" or "invalid_sku". Is this wrong? How am I supposed to detect a cancellation by the user? Other libraries I use have a "cancelled" state - does Amazon work slightly differently? Thanks in advance for your help, Ben
fire tabletsubmission testing distribution
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi benward12, Thank you for posting. Your app should not attempt to message any transaction state or status to the customer. In-App Purchasing API will handle all confirmations and messaging to the customer, including transaction success and failure messages. This is mentioned in our UI guide line for IAP implementation. Please refer this link for more information : https://developer.amazon.com/sdk/in-app-purchasing/documentation/cx-ux-guidelines.html#UI%20Guidelines
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Amazon Customer avatar image
Amazon Customer answered
Hi Sujoy, Thanks very much for your reply. That makes much more sense now. So it's not that I shouldn't show a dialog box when the user is cancelled, but rather that I shouldn't show any dialog boxes during the IAP flow, ever. Thanks for your help, have a great day. Ben
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.