有没有Android的GCM相当于一个到了iOS推送通知反馈服务?到了、反馈、通知、Android

由网友(柠檬不萌)分享简介:我们的web应用程序发送推送通知请求到iOS和Android设备。有关的iOS,苹果推送通知服务有一个反馈服务,使您可以检测到哪些设备已经卸载你的应用程序,然后从数据库中删除它。有没有为Android GCM了类似的反馈服务?如果不是,如何检测其Android用户不必再安装应用程序?解决方案 有没有为Android...

我们的web应用程序发送推送通知请求到iOS和Android设备。

有关的iOS,苹果推送通知服务有一个反馈服务,使您可以检测到哪些设备已经卸载你的应用程序,然后从数据库中删除它。

有没有为Android GCM了类似的反馈服务?如果不是,如何检测其Android用户不必再安装应用程序?

解决方案   

有没有为Android GCM了类似的反馈服务?

iOS 推送通知 详解 从创建到设置到运行

没有。

  

如果没有,如何检测其Android用户不必再安装应用程序?

引述文档:

     在最终用户卸载应用程序。   的第三方服务器发送消息给GCM服务器。   的GCM服务器发送消息给设备。   的GCM客户端接收关于是否有广播接收器配置为接收它,它会返回错误信息和查询包管理器。   的GCM客户端通知应用程序卸载的GCM服务器。   的GCM服务器删除标记注册ID。   的第三方服务器发送消息给GCM。   的GCM返回NotRegistered错误信息给第三方服务器。   的第三方删除注册ID。         

请注意,这可能需要一段时间的注册ID从GCM彻底清除。因此,有可能,在步骤7发送的邮件以上得到一个有效的消息ID作为响应,即使该消息将不会传递到设备。最终,注册ID将被删除,服务器将得到一个NotRegistered错误,没有任何进一步的行动从第三方服务器被要求(这种情况经常发生,而应用程序正在开发和测试)。

Our webapp sends push notification requests to iOS and Android devices.

For iOS, the Apple Push Notification Service has a feedback service so you can detect which devices have uninstalled your app and then remove it from your database.

Is there a similar feedback service for Android GCM? If not, how to detect which Android users no longer have the app installed?

解决方案

Is there a similar feedback service for Android GCM?

No.

If not, how to detect which Android users no longer have the app installed?

Quoting the documentation:

The end user uninstalls the application. The 3rd-party server sends a message to GCM server. The GCM server sends the message to the device. The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns false. The GCM client informs the GCM server that the application was uninstalled. The GCM server marks the registration ID for deletion. The 3rd-party server sends a message to GCM. The GCM returns a NotRegistered error message to the 3rd-party server. The 3rd-party deletes the registration ID.

Note that it might take a while for the registration ID be completely removed from GCM. Thus it is possible that messages sent during step 7 above gets a valid message ID as response, even though the message will not be delivered to the device. Eventually, the registration ID will be removed and the server will get a NotRegistered error, without any further action being required from the 3rd-party server (this scenario happens frequently while an application is being developed and tested).

阅读全文

相关推荐

最新文章