Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

How To support Amazon Appstore

Anastasiia Karimova edited this page Feb 26, 2015 · 16 revisions

In the Code

  1. In the AndroidManifest.xml declare the receiver

    <receiver android:name="com.amazon.device.iap.ResponseReceiver">
        <intent-filter>
            <action
                android:name="com.amazon.inapp.purchasing.NOTIFY"
                android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY"
            />
        </intent-filter>
    </receiver>
  2. Map the SKUs if required. Remember, the SKUs must be unique across your Amazon developer account.

    OpenIabHelper.mapSku(SKU_PREMIUM, OpenIabHelper.NAME_AMAZON, "org.onepf.trivialdrive.amazon.premium");
    OpenIabHelper.mapSku(SKU_GAS, OpenIabHelper.NAME_AMAZON, "org.onepf.trivialdrive.amazon.gas");
    OpenIabHelper.mapSku(SKU_INFINITE_GAS, OpenIabHelper.NAME_AMAZON, "org.onepf.trivialdrive.amazon.infinite_gas");
  3. In the proguard config file add

     # AMAZON
    -dontwarn com.amazon.**
    -keep class com.amazon.** {*;}
    -keepattributes *Annotation*
    -dontoptimize
    
  4. If OpenIAB is added as library project, the build path should contain Amazon SDK in-app-purchasing-2.0.0.jar.

Test

To test .apk with Amazon App Tester

  • for Amazond Tester environment

    • Download and install Amazon App Tester from Amazon website
    • Download JSON with in-app products from Amazon Developer Console and put JSON with in-app products to /mnt/sdcard
  • for OpenIAB

    # install for Amazon
    adb install -i com.amazon.venezia /path/to/YourApp.apk

We also recommend you to read Amazon instructions.

Issues related to Amazon Appstore

Useful Links