Transitioning from IAP v2.0 to the Appstore SDK
The Amazon Appstore SDK is the SDK for Amazon In-App Purchasing that supports Digital Rights Management (DRM) and In-App Purchasing (IAP) for Android apps. The Appstore SDK replaces the previous SDK, IAP v2.0. You can continue using IAP v2.0 for any existing apps, or transition them to the 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
- How to transition from Amazon-managed DRM to the Appstore SDK
- How to transition from the standalone IAP to the Appstore SDK
- Other changes to IAP
- Appstore SDK transition FAQ
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?", as shown in the following screenshot:
If you selected Yes, Amazon would add DRM to your app.
With the Appstore SDK, the Developer Console no longer displays this option. If you want to add DRM to your APK, use the DRM API (included in the Appstore SDK) to incorporate license checking in your app.
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's 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:
- In the Developer Console, create an Upcoming Version of your app.
- Configure your app with a public key and integrate the Appstore SDK into your Android project by following the instructions in Integrate the Appstore SDK.
- Add logic in your app to check for licenses by following the instructions in DRM for Android.
- 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:
- In Android Studio, remove the in-app-purchasing JAR from your app and any references to it.
-
Configure your app with a public key and 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). - 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 the LicensingService
class to determine the mode in which the SDK is currently running. Before invoking getAppstoreSDKMode()
, you must call LicensingService.verifyLicense()
.
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 hasn't been initialized by calling verifyLicense() . |
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.
- Why do I need to configure a public key?
- Adding a public key to your project is a requirement to use the Appstore SDK. The public key establishes a secure communication channel between the Amazon Appstore and your app. When you generate the public key from the Developer Console, Amazon generates a corresponding private key. These public and private keys form a key pair to sign license responses. Through this key pairing, you ensure that the users who install your app are authorized.
- 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.
- I get an error when making IAP calls in my app, how can I troubleshoot?
- Visit Appstore SDK Troubleshooting.
Last updated: May 22, 2024