Amazon

Amazon

https://docs.coronalabs.com/guide/monetization/IAP/index.html

https://developer.amazon.com/

Apps & Services

https://developer.amazon.com/home.html

Products

For instance, you are going to make IAP products like this

name type product id
book01 Entitlements com.kwiksher.bookshelf.book01
book02 Entitlements com.kwiksher.bookshelf.book02

https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/submitting-iap-items

Once you have added the products, download JSON data file. Later it is copied to App Tester


Build apk

You need a keystore file for IAP and use it for building .apk with Corona simulator

keystore file

syntax

sudo keytool -genkey -v -keystore yourapp.keystore -alias yourapp -keyalg RSA -validity 10000

for example,

sudo keytool -genkey -v -keystore kwikbookshelf.keystore -alias kwikbookshelf -keyalg RSA -validity 10000

build.settings and config.lua

the IAP plugin is added

build.settings

settings = {
    plugins  =  
        --Amazon IAP
        ["plugin.amazon.iap"] = {
            publisherId = "com.coronalabs",
            supportedPlatforms = { ["android-kindle"]=true }
        },
    },
}

Prepareing Test

https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/testing-iap

please read Suggested Testing Process. It describes the following tools

App Tester

Sandbox mode

store.isSandboxMode() is a Solar2D API. If you want to check if the app’s IAP is running with sandbox mode or not. You can use it with external codes.

Receipt Verification Service(RVS)

if you use server-side receipt verification, Amazon offers RVS sandbox though Kwik does not support server-side verification.

Live App Testing

testers will not be charged for any purchases that they make.

when your apk is ready to test, upload it for Live App Tesing.

https://developer.amazon.com/public/resources/development-tools/live-app-testing/docs/live-app-testing-understanding

https://developer.amazon.com/public/resources/development-tools/live-app-testing/docs/getting-started-with-live-app-testing

Testing without an Amazon Device

TODO: is it virtual device woking with Live App Testing?

https://developer.amazon.com/public/resources/development-tools/ide-tools/tech-docs/testing-without-an-amazon-device