onMessage won't be called until sync button clicked
When I send a message to ADM server and get the correct response from it, my handler's onMessage function won't be called until I click the sync button on the status bar or I restart the wifi (that will force the kindle fire to sync). But I do prefer instant notifications on my user's device if i send them messages. Anyone can give some help? Thanks in advance.
So the receiver which revives the message from the adm client has to be checked. Is the Class which extends ADMMessageReceiver (example : class MessageAlertReceiver extends ADMMessageReceiver) registered dynamically or Is the receiver declared in the manifest itself. because when adm client gets the message from the server it should be able to find the right filter to pass the intent. FYI: abstract ADMMessageHandlerBase-->(IntentService) - class has onMessage,onRegistrationError,onRegistrationError,etc methods
Hi Bipin, thank you very much for your reply. But I'm afraid that i didn't explain my problem well. I have registered my handler and receiver in the AndroidManifest.xml and my handler's onRegistered() get called immediately I call adm.startRegister(); However, onMessage() does not behave the same way. When I send a message to ADM server and get a 200 status code from ADM, onMessage() won't be called immediately. Sometimes it get called after 5 mins I got response. Sometimes it takes more than 2 hours. But any time I press the sync button on the status bar, onMessage() will definitely be called. And I got the same result when I use the sample code from the SDK. So I would like to ask whether sync is a must for receiving message and whether ADM can act like an instant message system. Thanks in advance.
ADM messages should be pushed down from the server to the device at the time of enqueue. While there is a polling mechanism, it's infrequent and shouldn't be the main mode of communicating messages to the device. If the the device connected behind a firewall or something similar, it could affect the ability of messages to be pushed to the device, potentially causing the behavior you are seeing.
Hi, I have the save issue and have been testing the problem on different networks. I ensured that all the necessary ports are open which include 5228, 5229, and 5230. Unfortunately, I still got the same result. Therefore, I'm just wondering if there's a way for the device to sync with ADM periodically so it can check if there're notifications in the queue and fetch them. Thanks