question

Vinayak Jadhav avatar image
Vinayak Jadhav asked

Sample ADM Messaging

Hi, I am trying to understand the ADM and got the sample application from the SDK. I got the client running but server just stands and wait saying " starting on port 8080" and does nothing. I have changed the client id and client secret also. I dont see anything happening on client as well nothing is happening on server. I also checked the php discussion happening on the forum but it doesnt seem to help me. Could some one guide me or provide the working example of the ADM? Thanks for the help.really stuck. Regards
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.

Vinayak Jadhav avatar image
Vinayak Jadhav answered
So, when i prerss "Regsiter" from client..nothing happens on server and client's onRegister() is called..amd in Logcat i see "Registration is stale, regsitration is refreshing" as an Info.no error. Why my device is not getting registered..please help !! thanks
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 Vinayak, Sorry for late response. But I did not understand your problem. Let me clear you how ADM works first. From the client first you need to register the device to ADM server that's running by Amazon. When you make a call to adm.startRegister(), the ADM SDK will try to register the app for the user currently logged in to the device. As a result you will receive a registration id a from ADM server. You need to pass this reg id to your app srever and persist it for future use. Now when you want to send a message to the particular user of your app, you should use the server side API for sending message. Then you need to use the reg id, client id and client secret (client id and client secret are associated with the API key that you have used in the client - in asset/api_key.txt file) In the provided sample, you will find Kindle client in ADMMessenger folder and follow the below example for sending message from a java based server https://developer.amazon.com/public/apis/engage/device-messaging/tech-docs/06-sending-a-message#Making%20the%20Message%20Request%20and%20Handling%20the%20Response
10 |5000

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