是否有等效于 iOS 推送通知反馈服务的 Android GCM? [英] Is there an Android GCM equivalent to the iOS Push Notification Feedback Service?

查看:19
本文介绍了是否有等效于 iOS 推送通知反馈服务的 Android GCM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的网络应用向 iOS 和 Android 设备发送推送通知请求.

对于 iOS,Apple 推送通知服务具有反馈服务,因此您可以检测哪些设备卸载了您的应用,然后将其从数据库中删除.

Android GCM 有类似的反馈服务吗?如果没有,如何检测哪些 Android 用户不再安装该应用?

解决方案

Android GCM 是否有类似的反馈服务?

没有

<块引用>

如果没有,如何检测哪些 Android 用户不再安装该应用?

引用文档:

<块引用>

  1. 最终用户卸载应用程序.
  2. 第 3 方服务器向 GCM 服务器发送消息.
  3. GCM 服务器将消息发送到设备.
  4. GCM 客户端收到消息并询问包管理器是否有配置为接收它的广播接收器,返回 false.
  5. GCM 客户端通知 GCM 服务器应用程序已卸载.
  6. GCM 服务器标记要删除的注册 ID.
  7. 第 3 方服务器向 GCM 发送消息.
  8. GCM 向第 3 方服务器返回 NotRegistered 错误消息.
  9. 第 3 方删除注册 ID.

请注意,从 GCM 中完全删除注册 ID 可能需要一段时间.因此,在上述步骤 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:

  1. The end user uninstalls the application.
  2. The 3rd-party server sends a message to GCM server.
  3. The GCM server sends the message to the device.
  4. The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns false.
  5. The GCM client informs the GCM server that the application was uninstalled.
  6. The GCM server marks the registration ID for deletion.
  7. The 3rd-party server sends a message to GCM.
  8. The GCM returns a NotRegistered error message to the 3rd-party server.
  9. 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).

这篇关于是否有等效于 iOS 推送通知反馈服务的 Android GCM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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