question

OnAir_Player avatar image
OnAir_Player asked

ADM with self signed APK

Hi there, so I have finally gotten ADM to work in debug mode. I would like to sign the APK myself (already have a build environment that does this and also applies proguard obfuscation). However, once I sign with my own keystore it stops working. I have created an API key for that certificate in the security profile and I have also put this productive API key into the api_key.txt in assets.No messages received. When I replace the api key with the debug one and run it from Eclipse (which signs with the debug key) then it works. Thanks!
amazon device messaging
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Daniel, Can you make sure that there are no trailing spaces in the production api key in api_key.txt ? Also, while using the production key, are you able to register ADM successfully? Are you getting callback in onRegistered() of your derived class of ADMMessageHandlerBase. If onRegistrationError() is being called please post the error string which is passed to this method. I can see there is a third api key in the same security profile what is being used in your app. Have you tried to use that API key? Is it working?
10 |5000

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

Christine Rosalie Fawcett avatar image
Christine Rosalie Fawcett answered
I was having the same problem. I realized from your post that the device I am testing on needed to unRegister and re-register for the new api_key. I did this and it worked. My question is is there any way for the code to know that the existing registration is not for the api_key it is using so that the device needs to be unregistered and reregister. Currently I have to temporarily change the code to unregister the device when I switch signatures which is a bit inconvenient. I realize it won't be a problem in the field since only one api_key will ever be used in the field. But it's a nuisance for testing purposes, and potentially error prone. Thanks Christine
10 |5000

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