如何处理GCM改变注册ID? [英] How to handle GCM changing the registration Id?

查看:121
本文介绍了如何处理GCM改变注册ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何将应用程序/设备,如果GCM服务器决定更新其应用程序$ P $从GCM服务器pviously检索registrationId通知。 目前,我省检索registrationId 1号,并将其保存在数据库中,并将其发送给registrationId应用服务器。因此,从下一次应用程序不会说话GCM服务器。 在这种情况下,应用程序将永远不会知道,如果registrationId由GCM服务器改变。谷歌文件提出一些处理的情况下,但它没有提什么应采取措施。 从谷歌报价 -

I was wondering how will app/device be notified if GCM server decides to refresh the registrationId which the app previously retrieved from the GCM server. Currently, I save the 1st retrieved registrationId and save it in the database and send this registrationId to App server. So, from next time App won't be talking to GCM server. In this case App will never know if the registrationId is changed by GCM server. Google document suggest something to handle the case, but it does not mention what steps should be taken. Quote from Google -

虽然在 com.google.android.c2dm.intent.REGISTRATION 意图通常后收到的请求是由应用程序,谷歌可能会定期刷新注册ID。因此,应用程序必须ppared在任何时间处理一下$ P $。

Although the com.google.android.c2dm.intent.REGISTRATION intent is typically received after a request was made by the application, Google may periodically refresh the registration ID. So the application must be prepared to handle it at any time.

任何建议将是有益的,

谢谢, SKU

推荐答案

老章ID继续工作一段时间,但谷歌发出一个新的使用在未来的响应canonical_id领域。

The old reg id continues to work for a while but Google send out a new one to be used in future in the canonical_id field of the response.

这篇关于如何处理GCM改变注册ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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