This project is a sample Flutter App to showcase how you can use Amazon Appstore IAP in your Flutter project using the plugin from Dooboolab
To run the app an test it with the Amazon Appstore, you will need the following:
- Flutter SDK installed
- Your favourite IDE
- An Amazon Appstore developer account
- An Amazon Fire device
The project is about a fictional music app GIOLAQ Music ( Note: I'm not an actual singer π¨βπ€ )
What you can purchase:
- The right to play the whole album of GIOLAQ
- The yearly subscription to all the music produced by GIOLAQ
- Tickets granting you access to GIOLAQ live music concerts (one ticket per concert)
These three in-app purchases correspond respectively to the three types of IAP supported by the Amazon Appstore:
- Consumables: Purchase that is made, then consumed within the app, such as extra lives, extra moves, or in-game currency. May be purchased multiple times.
- Entitlements: One-time purchase to unlock access to features or content within an app or game.
- Subscriptions: Offers access to a premium set of content or features for a limited period of time.
Note: Make sure to review our docs on IAP for Amazon Appstore.
-
Clone the following repository:
git clone https://github.com/AmazonAppDev/flutter-amazon-iap-demo
-
Create the following IAP items on the Amazon Appstore console:
- A subscription item with SKU
dev.giolaq.oneyear
- An entitlement item with SKU
dev.giolaq.album
- A consumable item with SKU
dev.giolaq.live
- A subscription item with SKU
-
To create the IAP items follow the instructions here or in this video
-
Download the IAP item json file from the Amazon Appstore console, instructions here
-
Upload the json file to the Fire Tablet using this command from the terminal
adb push <_Your_JSON_File_Folder_>/amazon.sdktester.json /sdcard/amazon.sdktester.json
-
Enable the Sandbox mode to test with virtual purchases (No real πΈ spent) using this command
adb shell setprop debug.amazon.sandboxmode debug
-
Install the IAP app tester from the Amazon appstore.
-
Build and run the Flutter app from your IDE setting as a target your Fire Tablet device.
At first launch, you will see the music page without a Play button since there are no purchases yet.
Head to purchase page to purchase one of the three different IAP items:
- Music Album
- Yearly subscription
- Ticket
Music Album and Yearly subscription will unlock the music in the music screen.
Ticket will increase the ticket counter in the music screen You can consume the ticket tapping on the ticket icon
If you have questions, comments, or need help with code, we're here to help:
- Ask questions in the Amazon developer community space
- Ask questions on Stack Overflow using the amazon-appstore tag
Sign up to stay updated with the developer newsletter.