规范注册 ID 和消息 ID 格式 [英] Canonical Registration ID and message ID format

查看:26
本文介绍了规范注册 ID 和消息 ID 格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 我在理解 Canonical Registration Id 和让 Google 返回时遇到问题.我故意注册了我的 Android 应用程序两次(以测试 Canonical Registration Id),但是当我尝试向两个 Registration Ids 推送消息时,我没有收到来自谷歌一个规范注册ID.

  1. I have a problem with understanding Canonical Registration Id and getting it returned by Google. I have deliberately registered my Android app twice (to test Canonical Registration Id) but when I try to push a message to both Registration Ids I don't get in the return from Google a Canonical Registration Id.

另外,我想知道谷歌返回的消息Id的格式是什么意思.我可以在日志中看到它似乎由三部分组成:%.知道它们是什么意思吗?第 3 部分是否识别设备?

In addition, I would like to know what the format of the message Id returned by Google means. I can see in the log that it seems to consist of three parts <something>:<something2>%<something3>. Any idea what they mean? Does the 3rd part identify the device?

[INFO com.bipper.filters.PushUpdatesFilter] [ messageId=0:1349819220154718%921c249a6e2555b5 ][信息 com.bipper.filters.PushUpdatesFilter] [ messageId=0:1349819220242456%921c249a6e2555b5 ]

[INFO com.bipper.filters.PushUpdatesFilter] [ messageId=0:1349819220154718%921c249a6e2555b5 ] [INFO com.bipper.filters.PushUpdatesFilter] [ messageId=0:1349819220242456%921c249a6e2555b5 ]

推荐答案

我设法通过这种方式从 GCM 获得了规范的注册 ID:

I managed to get a canonical registration id from GCM this way :

  1. 初始状态:应用程序安装在Android设备上并注册到GCM.发件人服务器具有注册 ID 并设法将消息发送到该设备.

  1. The initial state : Application is installed on Android device and is registered to GCM. Sender server has the registration Id and manages to send messages to that device.

卸载应用程序.

向原始(旧)注册 ID 发送两条消息.第一个似乎可以工作(服务器将收到来自 GCM 服务器的成功回复).第二次尝试将导致NotRegistered"错误.

Send two messages to the original (old) registration Id. The first will seem to work (server will receive a successful reply from GCM server). The second attempt will result in a "NotRegistered" error.

重新安装应用程序并注册到 GCM.设备将获得一个新的注册 ID.

Re-install the application and register to GCM. The device will get a new registration Id.

使用旧的注册 ID 发送消息.应用程序将收到消息,但服务器将在回复中获得新的注册 ID 作为规范注册 ID.

Send a message using the old registration Id. The application will receive the message, but the server will get in the reply the new registration Id as canonical registration Id.

这篇关于规范注册 ID 和消息 ID 格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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