Android:C2DM 在没有通知的情况下更改 registration_id?

标签 android android-c2dm

所以我有一种情况,根据我对注册的理解,我认为不会发生我的理解:

Phone Registers with google 获取 registration_id,将 registration_id 发送到服务器,在发送推送通知时使用 registration_id。如果 registration_id 被谷歌更新,他们将发送一个新的注册广播。

但是,我遇到过手机已注册并成功接收推送通知的情况,但有一天服务器将推送通知发送到手机,我收到错误“NotRegistered”,这表明 registration_id 已刷新但没有通过系统正确传播,无论是在电话端还是服务器端。

我的问题是还有其他人遇到过这样的问题吗?确保这种情况不会发生的最佳方法是什么?

最佳答案

来自Android Cloud to Device Messaging Framework文档:

Note that Google may periodically refresh the registration ID, so you should design your application with the understanding that the REGISTRATION Intent may be called multiple times. Your application needs to be able to respond accordingly.

关于Android:C2DM 在没有通知的情况下更改 registration_id?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8600369/

相关文章:

android - 无法执行同步(未调用 onPerformSync)

android - 如何在 SeekBar 拇指中间添加 TextView?

android - 需要Android C2DM的简单实现

安卓 C2DM : Determine if push notification can be delivered now

安卓 : How to notify the user when the Application is not running

push-notification - 推送通知(如 GCM)为何以及如何高效?

android - 谷歌电视支持 C2DM 吗?

android - 约束布局 - 具有最大宽度的两个 View

java - 使用数组适配器和 listView 时出现异常

android - 我的库如何在 Android Studio 中导入另一个库?