GCM通知重复问题。多次收到相同的消息 [英] GCM notification duplication issue. Received same message many times

查看:101
本文介绍了GCM通知重复问题。多次收到相同的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在处理GCM时发现了一个问题。如果您卸载该应用程序并重新安装,则会更改该设备的GCM注册ID。之前的注册ID仍然有效。所以在我的数据库中有多个注册ID是指一个设备。因此,只需在设备上多次收到一条通知即可。



请帮助我解决这个问题。 方案

您可以使用 canonical_id 解决此问题,该方法是调用发送推送消息时GCM响应的一部分。 Canonical Id可用于检测重复的注册ID,并可用于防止出现问题。

您也可以在以下链接阅读更多关于它的内容。

1-如何从GCM获得Canonical Id?



2-如何解决GCM重复邮件问题?


I have noticed one issue in dealing with GCM. If you un-install the app and install it again the GCM registration id is changed for that device. And previous registration id is still working. So in my database there are multiple registration ids which are referring to one device. So sending only one notification received multiple times on the device.

Please help me on this.

解决方案

You can solve this issue, with the use of canonical_id which is part of the response of GCM when called for sending push messages. Canonical Id can be used to detect duplicate register ids and you can use to prevent the problem.

Also you can read more about it in the following links

1- How to get Canonical Id from GCM ?

2- How to resolve the GCM duplicate messages problem ?

这篇关于GCM通知重复问题。多次收到相同的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆