简体   繁体   English

重新安装应用后,Android c2dm推送通知

[英]Android c2dm push notifications after app reinstall

I have the following question: 我有以下问题:

I've successfully implemented C2DM in my application. 我已经在我的应用程序中成功实现了C2DM。 I'm registering to both google c2dm cloud and a custom server that "creates" notification contents. 我正在注册到Google c2dm云和“创建”通知内容的自定义服务器。 Everything is working fine. 一切正常。 My question is : what happens when i uninstall my app and then reinstall it on the same device? 我的问题是:当我卸载我的应用程序并将其重新安装到同一设备上时会发生什么? I've noticed that C2DM is sending me back the same app_key, so apparently there's no way to determine my app installation status change. 我注意到C2DM会将相同的app_key发送回给我,因此显然无法确定我的应用安装状态更改。 And i keep on receiving old push notification (they're customized by user preferences in the app). 而且我继续收到旧的推送通知(它们由应用程序中的用户首选项自定义)。 I won't be able to test with a google play published app until final release, so i would like to know if there's a chance that google itself could notify c2dm that the app was uninstalled on my device and force it to change my app_id at next restart. 在最终版本发布之前,我将无法使用Google Play发布的应用进行测试,因此我想知道Google是否有机会自己通知c2dm该应用已在我的设备上卸载并强制其更改我的app_id。下次重启。

Thanks in advance Stefano 在此先感谢Stefano

From what I understand in C2DM, you shouldn't depend on Google's registration ID by itself. 据我对C2DM的了解,您不应单靠Google的注册ID。 They "promise" nothing - you might even get a new registration ID without a clear reason (might be their own vrsion upgrades, etc.). 他们“无条件”承诺-您甚至可能会在没有明确原因的情况下获得新的注册ID(可能是他们自己的版本升级等)。
If you want to follow installation - you should do it with your own server - create a unique identifier whenever the app asks for registration, and use it and not the Google's registration ID. 如果要进行安装-您应该使用自己的服务器进行安装-每当应用要求注册时,都创建一个唯一的标识符,并使用它而不是Google的注册ID。
Regarding to Google Play - couldn't find a difference between published app and unpublished one - the behavior seems to be the same. 关于Google Play-在已发布的应用程序和未发布的应用程序之间找不到区别-行为似乎是相同的。
Hope this helps somehow. 希望这会有所帮助。
Shushu 鼠鼠

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM