question

OnAir_Player avatar image
OnAir_Player asked

not receiving messages (everything else works)

Hi, I have almost successfully setup ADM for my app. I am retrieving a registration ID, sending it to my server. On the server I can send the messages (the response looks like {"registrationID":"amzn1....} with the same registrationID that I used to send. So it looks like sending works. Also the registrationID is the same that the device got at new ADM().getRegistrationId(). The device is registered (I use a Kindle Fire HD 7" emulator that I registered to my amazon account). The problem is that the onMessage(Intent) method is never called. I carefully added all manifest entries from your tutorial and replaced the package everywhere. public class ADMHandler extends ADMMessageHandlerBase { public ADMHandler() { super(ADMHandler.class.getName()); } public ADMHandler(String className) { super(className); } @Override protected void onRegistered(final String registrationId) { registerIdWithServer(registrationId); } @Override protected void onUnregistered(final String registrationId) { } @Override protected void onRegistrationError(final String errorId) { //.... } @Override protected void onMessage(final Intent intent) { // NEVER CALLED } } public class ADMReceiver extends ADMMessageReceiver { public ADMReceiver() { super(ADMHandler.class); } } I have activated DeviceMessaging in the Amazon Appstore, but the app was not yet published. I have already checked all the other forum posts (been trying to get this to work for 2 days now). No luck. Any help is highly appreciated!
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.

Bipin@Amazon avatar image
Bipin@Amazon answered
Hi, Is the feature enabled in manifest also check if there is api_key.txt in assets folder https://developer.amazon.com/sdk/adm/integrating-app.html#Asset
10 |5000

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

OnAir_Player avatar image
OnAir_Player answered
yes, both is the case. Feature is enabled and api_key.txt exists in the asset folder with only the key as content (no spaces or newlines). Exactly as described in the docs. And as I said, everything else works. registration, server side sending. Only the onMessage() never fires! Message was edited by: daniel_123
10 |5000

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

Bipin@Amazon avatar image
Bipin@Amazon answered
Is the device connected to internet through the firewall ? Try clicking the sync button. Sync button is in the notification area, you can access sync button by pulling down the notification bar.
10 |5000

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

Jagriti Goyal avatar image
Jagriti Goyal answered
Daniel: I am facing exactly same problem. I have gone through your posts in this thread and my problem is world to world same to your problem. Have you able to solve it please share your solution with the community.
10 |5000

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

Jagriti Goyal avatar image
Jagriti Goyal answered
I am facing exactly the same as stated above. Bipin can you suggest me how to track down the problem. The internet is working in emulator. I know that some time internet is working in the computer but not in emulator but this is not the case with me. I have followed the steps you suggested in this thread. And my onMessage method is not called. On the server end we are getting 200 OK when send request for sending push.
10 |5000

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

adm-support avatar image
adm-support answered
Hi Jagriti. I am a developer on the ADM team. Have you verified that your manifest is authored correctly? You can use the ADMManifest.checkManifestAuthoredProperly() method to verify your manifest as detailed here: https://developer.amazon.com/public/apis/engage/device-messaging/tech-docs/04-integrating-your-app-with-adm
10 |5000

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