Android C2DM message received confirmation at App Engine side
Is there a way I can get the information whether the c2dm message was sent to a device or still in queue somewhere on App Engine side? The device won't get the messages if it's on some WiFi access point (rando开发者_JS百科m behavior).
I want to implement time limit to the notification messages. If the time is up, the messages make no sense anymore and should never be delivered.
You shouldn't be sending information, however small, directly to your users through C2DM. C2DM is designed to be used as a way to alert your device that there is new information on the server. Your client should then connect with the server to download the relevant information. If you follow this design pattern, then between your client-side and server-side code, I'm sure you can easily figure out if a message is stale or not.
Please note that Glendon has the best solution. Another way would be to include the time sent with the message. Then calculate how far in the past that message was sent when received on the phone, taking no action if it is too old.
精彩评论