Developer Console

Transitioning to the Appstore SDK

The Amazon Appstore SDK is a new SDK for Amazon In-App Purchasing. The Appstore SDK supports Digital Rights Management (DRM) and In-App Purchasing (IAP) for Android apps.

The Appstore SDK will replace the previous SDK, IAP v2.0. Use the Appstore SDK for any new apps you submit to the Amazon Appstore. You can continue using IAP v2.0 for any existing apps, or transition them to the new Appstore SDK. This page guides you through the steps to transition apps to the Appstore SDK.

You can download the Amazon Appstore SDK from the SDK Downloads page.

What Changes about DRM and IAP

Previously, when you uploaded Android APKs into the Amazon Appstore, you had the option to select Yes or No for "Apply Amazon DRM?" on the APK Files tab, as shown in the following screenshot:

If you selected Yes, the Appstore would wrap your APK with code allowing Amazon to enforce DRM for your app.

With the new Appstore SDK, Amazon no longer adds this wrapper around your APK after you submit it.

Instead, if you need DRM for your Java Android app, you need to take some extra steps to incorporate some license checking functions in your app through the DRM API (available through the Appstore SDK).

Previously, when you wanted IAP functionality, you downloaded a standalone IAP JAR and incorporated it into your app. As of Appstore SDK, the IAP API is no longer available as a separate JAR file; instead, it is bundled with the Appstore SDK JAR file. To implement IAP, you must incorporate the Appstore SDK.

See Other Changes to IAP below for details on how you now determine the mode in which the IAP runs.

How to Transition from Amazon-managed DRM to the Appstore SDK

If your existing app uses Amazon-managed DRM, switch to the DRM API by doing the following:

  1. In the Developer Console, create an Upcoming Version of your app.
  2. Integrate the Appstore SDK into your Android project by following the instructions in Integrate the Appstore SDK.
  3. Add logic in your app to check for licenses by following the instructions in DRM for Android.
  4. Build a new version of your APK, upload it into the Developer Console, and submit it.

How to Transition from the Standalone IAP to the Appstore SDK

If your existing app integrates the standalone IAP API, you must switch to the new Appstore SDK by doing the following:

  1. In Android Studio, remove the in-app-purchasing JAR from your app and any references to it.
  2. Integrate the Appstore SDK into your Android project by following the instructions in Integrate the Appstore SDK.

    The same code you previously added for IAP will work with the Appstore SDK. Older functionality in the IAP API remains unchanged (except for IS_SANDBOX_MODE, which is used for testing – see Other Changes to IAP below).

  3. Build the new version of your APK, upload it into the Developer Console, and submit it.

Other Changes to IAP

Most of the IAP implementation details have remained the same apart from the IS_SANDBOX_MODE value in the PurchasingService class which is removed in the Appstore SDK.

You must now call the getAppstoreSDKMode() method of PurchasingService class to determine the mode in which the SDK is currently running. Note that you must invoke the getAppstoreSDKMode() method after calling registerListener().

public enum AppstoreSDKModes {

    SANDBOX,
    PRODUCTION,
    UNKNOWN
}

The following table describes the different modes.

SDK Modes Description
SANDBOX App is being tested and interacts only with the Amazon App Tester.
PRODUCTION App communicates with Amazon Appstore and customer accounts for all the API calls. Note that only apps submitted to the Amazon Appstore receive successful responses from Amazon.
UNKNOWN This mode indicates that the SDK is not initialized by calling registerListener.

Appstore SDK Transition FAQ

Do I need to handle my own signature from now on? What happens if I lose my signing key?
Amazon still manages your app's signature when you submit your app. Having Amazon manage your signature protects you in case you lose your signing key. Without an Amazon-managed signature, if you were to lose your signing key, you would no longer be able to update your app.
What signature does Amazon use to sign apps?
Amazon uses V1 signing currently.
Will the Appstore SDK affect the Receipt Verification Service (RVS) with IAP?
There is no other impact to RVS.
How do I migrate from my current IAP implementation to the Appstore SDK?
The IAP implementation code remains the same, so you shouldn't update your existing IAP code to accommodate the new Appstore SDK (other than including the Appstore SDK JAR in your app). See How to Transition from the Standalone IAP to the Appstore SDK above for details.
Will my existing IAP integration break after Amazon launches the Appstore SDK?
No, the IAP integration in your published app continues to function normally. (Amazon will not modify any code to apps that have already been published.) Since the Appstore SDK provides the same IAP code as that which was previously available in the standalone IAP API, the result in the published app is virtually the same.
Will the Appstore SDK affect Live App Testing (LAT)?
There is no impact to the LAT behavior.
Will the Appstore SDK affect the App Tester app used for testing apps with IAP?
The Appstore SDK supports a new App Tester.
With respect to the 65K method limit for Android, if I only need DRM or IAP, not both, can I select a more specific JAR rather than incorporating a larger Appstore SDK?
No, the Appstore SDK is not available in multiple JARs.
Do I need to incorporate both IAP and DRM into my app?
IAP protects your in-app purchases; DRM protects your app from unauthorized distribution. You can implement both as desired. See section What Types of Apps Can Use DRM for details about different scenarios.
Will the inclusion of the Appstore SDK trigger the Appstore to add a note to my app details page saying that my app contains in-app purchases?
No, if you don't implement IAP, your app description does not say anything about your app including in-app purchases.
Will I need to get a new public key for each new version of my app?
No, you can use the same public key from one upcoming version to the next.

Last updated: Oct 18, 2021