开发者

C2DM registrationId handling -Best Practice?

开发者 https://www.devze.com 2023-04-09 02:46 出处:网络
Here\'s th开发者_开发百科e situation I\'m struggling with.When a user installs my app and runs it for the first time, I register with C2DM and get the registrationID.I then send it to my server and no

Here's th开发者_开发百科e situation I'm struggling with. When a user installs my app and runs it for the first time, I register with C2DM and get the registrationID. I then send it to my server and notifications are sent to the app.

If the user uninstalls the app, then installs it again, a new registration is made to C2DM and I receive a new registrationID.

The problem is, the server now has two registrationID's for the same app and I get multiple/redundant notifications to onMessage. What is the best practice way of avoiding this situation?


When we send the registrationId to our server we generate an identifier that can be constantly reproduced client side to identify the registrationId to the specific user. This also allows us to unregister the user if we wanted the option, as a plus it eliminates your issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号