Android C2DM message received confirmation at App Engine side

本小妞迷上赌 提交于 2019-12-08 10:28:52

问题


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 (random 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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/6726581/android-c2dm-message-received-confirmation-at-app-engine-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!