Amazon Appstore IAP testing

To test in-app purchases for your app destined for the Amazon Appstore, you have two options:

  1. Test in production, by distributing your app via Amazon's Live App Testing
  2. Test in sandbox, by side loading your app and using the Amazon Tester App

Let's look at what's required for each now.

Production Testing

To test in production, you need to distribute your app via Amazon Live App Testing. Details can be found in Amazon's documentation here.

You must include your Appstore public key in your app in order to conduct product IAP testing. Learn details on configuring your key here.

You may receive an error like this if your key is not properly setup:


Missing Products on your Paywall in Production?

Please make sure you have Amazon products attached to your paywall. First, you need to setup the IAP items in the Nami Control Center per this guide.


Missing Key Generates this Error:

2023-02-06 16:12:46.136 9330-9361/ E/Kiwi: AbstractCommandTask: On Exception!!!!: DATA_AUTH_KEY_LOAD_FAILURE: CERT_FAILED_TO_LOAD: error:0c000079:ASN.1 encoding routines:OPENSSL_internal:HEADER_TOO_LONG/java.lang.RuntimeException:error:0c000079:ASN.1 encoding routines:OPENSSL_internal:HEADER_TOO_LONG


Key is Present, but App is Sideloaded so No Production IAP Auth

E/Kiwi: AbstractCommandTask: On Exception!!!!: AUTH_TOKEN_VERIFICATION_FAILURE: null: null

Sandbox Testing

To test in the sandbox, you can side load your app to an Amazon Fire TV device.

In order for to conduct purchase testing you also need to install and setup the Amazon App Tester app on the device. See more details from Amazon's documentation, here.


Missing Products on your Paywall in Sandbox?

Be sure you've following Amazon's instructions on pushing IAP items to your device via adb.

The IAP items also need to be configured in the Nami Control Center per this guide.


How do I turn on Sandbox mode?

$ adb shell setprop debug

How do I push IAP items to my device for side loaded IAP tests?

$ adb devices
# ^^ note your Amazon device's serial number for use below
$ adb -s AMAZON_DEVICE_SN push amazon.sdktester.json /sdcard/amazon.sdktester.json

What does "E/Kiwi: AbstractCommandTask: On Exception!!!!: AUTH_TOKEN_VERIFICATION_FAILURE: null: null" mean?

Amazon IAP found your Appstore public key, but you are side loading your app. For side loading, you need to use the Amazon App Tester to test IAPs.