question

michaeltractive avatar image
michaeltractive asked

onRegistered - Callback is never called

Hi! I am having troubles getting my Device Messaging to work. Probably its just a rooky mistake but nonetheless i am stuck! In the assets/ api_key.txt i copied the MD5 hash from my debug keystore: AA:AA:40:A5:D4:32:47:B5:66:46:18:A3:58:42:02:DF Manifest.xml Permissions are all set cause i do not get any exception. MainActivity.java ( there is no exception and also adm.startRegister() is called without any issues. try { final ADM adm = new ADM(MainActivity.this); if (adm.getRegistrationId() == null) { // startRegister() is asynchronous; your app is notified via the // onRegistered() callback when the registration ID is available. adm.startRegister(); } catch (Exception e) { TTLog.e(TAG, "NO Amazon Push registered!"); } MyADMMessagHandler.java (no functions of that class are called, and i have no clue why) public class MyADMMessageHandler extends ADMMessageHandlerBase { private NotificationManager mNotificationManager; public static final int NOTIFICATION_ID = 1; /** * Class constructor. */ public MyADMMessageHandler() { super(MyADMMessageHandler.class.getName()); } /** * Class constructor, including the className argument. * * @param className * The name of the class. */ public MyADMMessageHandler(final String className) { super(className); } private static final String TAG = "MyADMMessageHandler"; public static class Receiver extends ADMMessageReceiver { public Receiver() { super(MyADMMessageHandler.class); } // Nothing else is required here; your broadcast receiver automatically // forwards intents to your service for processing. } @Override protected void onRegistered(final String newRegistrationId) { //never gets here. } Anyone knows what I am missing? appreciate any help. thanks Michael
amazon device messaging
10 |5000 characters needed characters left characters exceeded

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

1 Answer

Bipin@Amazon avatar image
Bipin@Amazon answered
Hi, In the assets/ api_key.txt - there should be api key (not MD5 of signature) api key is generated using pacakage name and MD5 in the portal (In "Apps & Services > My Apps", select the app with which you want to use ADM.Select the "Security Profile" link for the app) for detailed steps, you can check: https://developer.amazon.com/sdk/adm/credentials.html
10 |5000 characters needed characters left characters exceeded

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