Skip to content

This project demonstrates how to integrate the Amazon In-App Purchasing (IAP) API into a Kotlin Android app for Amazon Fire tablets, including testing with the Amazon App Tester in sandbox mode. πŸ’°πŸ›’πŸ“±

License

AmazonAppDev/amazon-iap-kotlin

Android build

Amazon IAP Kotlin Example

This project is a simple demonstration of the Amazon IAP API on a Amazon Fire Tablet.

πŸ’» Building the IAP demo

  1. Clone the demo app repository: git clone https://github.com/AmazonAppDev/amazon-iap-kotlin.git
  2. Connect your Fire tablet device following these instructions.

πŸ§ͺ How to test with In-App Items

Step 1: Push the example amazon.sdktester.json file to your device using the command:

adb push <_Your_JSON_File_Folder_>/amazon.sdktester.json /sdcard/amazon.sdktester.json

This JSON file is usually created when you create IAP items in the developer portal, however, for the sake of this demo we can use an example JSON.

Step 2: Set your app in sandbox mode using the following command:

adb shell setprop debug.amazon.sandboxmode debug

Sandbox mode constrains calls that would normally go to the Appstore client to route to the Amazon App Tester app instead. Use this mode only for testing locally.

Step 3: Install the IAP app tester from the Amazon appstore. Once you install it you should be able to see the JSON file of the IAP items you created.

image

You can now run the demo app!

Note: When you run the demo app, it uses the App Tester, which allows you to test the In-App Purchasing (IAP) functionality of your app in sandbox mode.

πŸ‘©β€πŸ’» Building your app

You can use this demo as a starting point to build a Kotlin app with an integration to the Amazon IAP API. To learn more about the API you can check out the documentation or the YouTube series I created.

Get support

If you found a bug or want to suggest a new [feature/use case/sample], please file an issue.

If you have questions, comments, or need help with code, we're here to help:

Stay updated

Get the most up to date Amazon Appstore developer news, product releases, tutorials, and more:

Authors

About

This project demonstrates how to integrate the Amazon In-App Purchasing (IAP) API into a Kotlin Android app for Amazon Fire tablets, including testing with the Amazon App Tester in sandbox mode. πŸ’°πŸ›’πŸ“±

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published