- API key(s). ADM uses an API key to verify your app’s identity.
- OAuth Credentials (“Client ID” and “Client Secret”). ADM uses OAuth credentials to verify your server’s identity. Your server presents these credentials to obtain access tokens for sending messages using ADM.
Obtain your API key and credentials
- Create an account on the Developer Console and add your app, if you haven’t already done so.
- From the navigation bar, choose My Apps. Find your app, expand the row, and then select View to open the app listing.
- In the sidebar, click App Services.
- In the Device Messaging section, click Select existing security profile or create new. (If you have already assigned a security profile to your app, expand the Attached security profile and related details section and proceed to step 7.)
- To assign a security profile to your app, choose an existing security profile from the Security Profile drop-down menu, or click Create Security Profile to create a new profile. A security profile provides the OAuth credentials that you use when sending messages with ADM.
- After selecting an existing security profile, click Enable Security Profile to save your changes. A success message appears that says, “Device messaging was successfully enabled on your app using <Security Profile Name> security profile.”
- Click the View Security Profile link. Then under Security Profile Management, click Android/Kindle Settings.
-
Click the Add an API Key button to create an API key. Your app requires one or more API keys.
- Debug application signature: In all cases, you must create an API key for the debug version of your app to test your app with ADM.
-
Release application signature: If your app uses the Appstore SDK, you must create an additional API key for the release version of your app. If using the older IAP SDK v2.0 and you sign your app using your own certificate, you must also create an API key for the release version of your app. In contrast, if using the IAP SDK v2.0, or no in-app purchasing SDK at all, and you allow Amazon to sign your app on your behalf, you do not need to create an additional API key. For a summary, see the following table.
Determine if you’re required to create an API key for your release app.
App uses the Appstore SDK App signed with your own certificate API key required? Yes Yes Yes No
com.mycompany.bestapplication), and the MD5 and SHA-256 values of your app’s signature:-
Debug application signature (used for pre-release version of your app): You can obtain the MD5 or SHA-256 signature of the certificate used to sign the debug version of your app by doing one of the following:
-
Locate the keystore file that is used to sign your app, as well as the alias of the certificate within the keystore file used for signing. For example, if the keystore file is named
my_key_storeand the certificate within the keystore that is used for signing is calledmy_certificate_alias, you would run the following command:The output should contain an MD5 or SHA-256 value similar to the following. This is your application signature. -
Or, if your app is in the form of a signed APK and you are developing on a Unix-like system, you can run the following command instead. Note that you must replace
{your-app.apk}with the name of your APK file. MD5:SHA-256: - Or, if you are using Android Studio, click the Gradle side pane on the right and expand it. Then expand app > Tasks > android and double-click signingReport. Provide the MD5 and SHA-256 output that is returned.
-
Locate the keystore file that is used to sign your app, as well as the alias of the certificate within the keystore file used for signing. For example, if the keystore file is named
-
Release application signature (for the production version of your app):
- If you sign the release version of your app using your own certificate, provide the MD5 and SHA-256 signature for that certificate to create an additional API key.
-
If you don’t use your own certificate, to obtain your MD5 and SHA-256 signature:
- Sign in to the Developer Console.
- From the navigation bar, choose My Apps.
- Find your app, expand the row, and then select View to open the app listing.
- From the sidebar, click Release Tracks, and then click View on a release track.
- At the top of the screen, click Appstore Certificate Hashes.
- It’s possible you might not need an API key, see the table in Determine if you’re required to create an API key for your release app for details.
- Click Add.
- Obtain Client credentials (required for calling ADM servers). Under Security Profile Management, click the Web Settings tab. You can find the Client ID and Client Secret on this page.
Store your API key
For a pre-release or “debug” version of your app, you must create an API key and store it in your project. To add the API key to your app:- Create a file called
api_key.txtlocated inside your project’s assets folder. Placing the file in this specific directory is required. - Insert your API key as the only data in this
api_key.txtfile.






