Android的C2DM - 如果注册ID被刷新,会发生什么 [英] Android C2DM - What happens if registration ID gets refreshed

查看:144
本文介绍了Android的C2DM - 如果注册ID被刷新,会发生什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我'目前发送登记意向到谷歌服务器,每次应用程序启动。我得到一个不同的注册ID,每次我这样做,虽然旧的仍然有效。我想那不是一个好办法做到这一点。
所以我想我应该发送注册意图只有一次 - 在应用程序的第一次启动。现在我的问题,如果谷歌刷新注册ID,请他们告知该应用程序?我的内部消除应用程序发送什么给他们?

in my Application I'am currently sending a registration intent to the google server everytime the app starts. I get a different registration ID everytime I do that, though the old ones still work. I guess thats not a good way to do it. So I thought that I should send the registration intent only once - at the first start of the app. Now my question, if google refreshes the registration ID, do they inform the application about that? Whithout my app sending anything to them?

推荐答案

我有一个C2DM和我的解决办法是对应用程序的每个开始登记,但使用发送通过我的服务器C2DM消息时,当删除的项数据库如果错误code是一个 InvalidRegistration

I have an C2DM and my solution was to register on every start of the application, but when using when sending the C2DM messages through my server delete the entry of the database if the error code was a InvalidRegistration

因此​​,如果设备注册了多次,我只发送一个无效的消息。

So if a device was registered multiple times, I only send one invalid message.

这篇关于Android的C2DM - 如果注册ID被刷新,会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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