question

Adrian Racu avatar image
Adrian Racu asked

api_key.txt for release builds

Hi.


I'm trying to integrate A3L into our app for Kindle Fire compatibility, but I'm not 100% clear about API keys. As far as I understood, I should make 3 API keys for each scenario:


  • Scenario 1: debug build that has a debug API key, matching my personal debug.keystore
  • Scenario 2: release build that has a release API key that matches our normal GPlay release keystore. We normally distribute this release APK to QA
  • Scenario 3: Amazon Android store release build with an API key that matches the Amazon appstore certificate hashes specified for my app.


If the above is right, I have 2 questions:


Q1: No matter if our our testers install an APK from scenario 1 or 2 on a Fire tablet, notifications should work in both cases right? Assuming the debug/release builds have the appropriate API keys set.

Q2: For the Android Store upload, do I need to ensure it has the correct api_key bundled in the APK? Or will Amazon overwrite the contents of they `api_key.txt` while also replacing the signature?



amazon device messagingapi
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Cristian Palasanu avatar image
Cristian Palasanu answered

I'm also interested in this topic.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered

Hi Adrian,

Thanks for posting! Your first assumption is correct: for the debug version of your app, you should create an api_key.txt file and use it while you are testing your app locally on device, before submission. Normally, you would login to your Developer Portal account, go to Security Profiles, create one for your app, and then download and integrate it in your project. I would strongly recommend going through this entire article to understand the process better:

https://developer.amazon.com/docs/app-porting/device-messaging-fit-obtain-api-key.html

As for your questions:

1. Notifications should start working once your upload your app to Developer Portal. Even if you are not planning to go live yet, please still upload it to the beta environment (Live App Testing) to start testing notifications.

2. If you are using the (older) 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.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Adrian Racu avatar image
Adrian Racu answered

Thanks for answering!


Just to confirm on point 2, the app is free and has no in-app purchasing SDK enabled.

So I can upload the APK with my release certificate & api_key.txt that matches my release certificate, Amazon will then re-sign it and notifications will still work?



10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.