Android的C2DM发件人ID [英] Android C2DM sender id

查看:251
本文介绍了Android的C2DM发件人ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直与德C2DM的某个时候和它一直致力于完美。最近,我碰到了,我似乎无法修复,并不能在这个论坛,可以帮助任何一个问题。问题是,我有一个使用C2DM几个应用程序,我已经让所有的应用程序具有相同发件人ID,然后注册用户在我的数据库令牌注册。这个问题如果用户有两个我的应用程序急症室; B(同一发件人ID),并启动应用程序A和I发送推送通知用户与应用程序B,用户是谁发动一个应用程序,最后将接受它实际上用于应用程序B.

I've been working with de C2DM for sometime and its has been working perfect. Recently I've bumped into a problem that I can't seem to fix and couldn't anything on this forum that might help. The problem is that I have several apps that use C2DM, I've let all apps register with the same sender id which then registers the users token in my database. The problem if a user has two of my apps A & B (same sender id) and launches app A and I send a push notification to users with app B, user who launched app A the last will receive a message which was actually intended for app B.

我的问题是有用于安装1台设备?

My question is there a way to use the same sender id for all apps installed on 1 device?

推荐答案

没有。一个C2DM注册ID的作用范围是一个应用在一个设备上。如果一个C2DM消息被发送到一个注册ID,它仅会被传递到一个应用程序。你应该从一开始就采用了不同的C2DM账户,所以每个应用程序都有自己的注册ID。注册ID不是每个设备,它们是每个应用每设备。

No. A C2DM Registration ID is scoped to one app on one device. If a C2DM message is sent to a Registration ID, it will only ever be delivered to one app. you should have used different C2DM accounts from the start, so each app has its own registration ID. Registration IDs are not per device, they are Per App Per Device.

如果您不能重新配置的注册ID,那么你可以使用一个接收器,然后发送一个广播的意图,无论您的应用程序可以通过响应的广播把它捡起来。我希望你既需要应用到监听和转播,但它应该工作。我建议您重新配置C2DM的使用寿,作为当前的设置是不理想,我希望这个问题只会变得更糟。

If you cannot reconfigure the registration IDs then you could use a receiver that then sends a broadcast intent, and both your apps could pick it up by responding to that broadcast. I expect you'd need both apps to listen-and-rebroadcast, but it should work. I'd advise you reconfigure your C2DM usage tho, as your current setup is not ideal and I expect the problem will only get worse.

当你说发件人ID你的意思是注册ID我承担。

I assume when you say "sender id" you mean registration id.

这篇关于Android的C2DM发件人ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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