- OAuth credentials — a Client ID and Client Secret, which OneSignal uses to authenticate with the ADM servers.
- An API key — which ADM uses to verify your app’s identity on-device. This key is stored inside your app’s project.
Requirements:
- An app already added to the Amazon Developer Console.
- An Amazon Developer account.
- A OneSignal Account, if you do not already have one.
Create or assign a security profile
Log in to the Amazon Developer Console.From the top navigation bar, choose My Apps. Find your app, expand the row, and 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.Choose an existing profile from the Security Profile drop-down menu, or click Create Security Profile to create a new one. A security profile provides the OAuth credentials you’ll use to send messages with ADM.Click Enable Security Profile to save. You should see a success message confirming device messaging was enabled on your app.
If you have already assigned a security profile to your app, expand the Attached security profile and related details section and skip ahead to the next step.
Generate an API key
The following steps let you test push notifications before publishing your app to the Amazon Appstore.Click the View Security Profile link. Under Security Profile Management, click the Android/Kindle Settings tab.Click Add an API Key. To create the key, provide:To obtain your signature values, use any of the following:
- API Key Name — any name you like.
- Package name — your Android package name (for example,
com.mycompany.bestapplication). This value is case sensitive. - MD5 and SHA-256 signatures of the keystore used to sign your app.
Amazon now requires both the MD5 and SHA-256 values of your signing certificate.
-
From your keystore (replace the alias and keystore name with your own):
-
From a signed APK (on a Unix-like system):
- From Android Studio — open the Gradle side pane, expand app > Tasks > android, and double-click signingReport.
Get your OAuth credentials (Client ID and Client Secret)
Still under Security Profile Management, click the Web Settings tab.Copy the Client ID and Client Secret shown on this page. You’ll paste these into OneSignal in the next step.
Configure your OneSignal app's Amazon platform settings
In the OneSignal dashboard, select your app from the All Apps page, then go to Settings. Under Native App Platforms, click Amazon Fire.Paste your Client ID and Client Secret into the fields and click Save.
Store the API key in your app
Save the API key you copied earlier into a new file named
api_key.txt.Place this file inside your project’s assets folder. This location is required for ADM to find the key.For a release (production) build, you may need to generate an additional API key depending on how your app is signed. If your app uses the Appstore SDK, or you sign the release build with your own certificate, create a separate API key for the release signature. If you use IAP SDK v2.0 (or no in-app purchasing SDK) and let Amazon sign your app, no additional release key is needed.More details on the placement of this file can be found in our Amazon SDK Setup documentation.Done! You now have the OAuth credentials and API key needed to send push notifications to your Amazon app. 🥳Return to the Amazon SDK Setup guide to install the OneSignal SDK in your app.