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

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

问题描述

  1. 我有理解规范注册ID ,并得到它返回谷歌的一个问题。我特意注册我的Andr​​oid应用程序两次(测试规范注册ID ),但是当我试图推动一条消息,既注册IDS 我没有从谷歌的收益获得规范注册ID

  2. 另外,我想知道是什么消息ID由谷歌返回的格式表示。我可以在日志中看到,似乎由三部分组成<东西>:< something2>%< something3> 。任何想法,他们是什么意思?请问第三部分识别设备?

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

解决方案

我设法从GCM获得规范注册ID是这样的:

  1. 初始状态:应用程序安装在Android设备,并注册到GCM。发件人服务器的注册ID和管理将消息发送到该设备。

  2. 卸载应用程序。

  3. 发送两个消息到原来的(旧)注册ID。第一个将似乎工作(服务器将收到来自GCM服务器的成功答复)。在第二次尝试将导致NotRegistered错误。

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

  5. 发送使用旧的注册ID的消息。该应用程序将收到消息,但服务器将在回复新的注册ID为规范注册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.

  2. 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 ] [INFO com.bipper.filters.PushUpdatesFilter] [ messageId=0:1349819220242456%921c249a6e2555b5 ]

解决方案

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

  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.

  2. Uninstall the application.

  3. 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.

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

  5. 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天全站免登陆