GCM发布通知,以现有的C2DM注册ID [英] Posting GCM notification to existing C2DM registration ids
问题描述
我想知道是否有可能使用基于C2DM新GCM机制和后通知我现有的注册ID?
I am wondering if it is possible to use the new GCM mechanism and post notifications to my existing registration IDs that are based on C2DM?
迁移/ GCM文件没有触及这部分,但它暗示,它可能无法工作,因为它提到的,我们必须从C2DM注册ID单独存储GCM注册ID。
The migration/GCM documentation didn't touch on this part, but it's implied that it may not work because it mentioned we have to store the GCM registration ids separately from C2DM registration ids.
这也意味着,迁移到GCM,我们需要保持两套注册ID,并使用两个单独的呼叫(GCM和C2DM)对于可预见的未来,对吗?
This also means that to migrate to GCM, we need to maintain two sets of registration ids, and use two separate calls (GCM and C2DM) for a foreseeable future, am I right?
推荐答案
刚才试了一个实验自己,同时采用GCM将消息发送到由C2DM创建的注册ID,我得到的错误MisMatchedSenderId。这是有道理的,因为旧的C2DM使用一个电子邮件地址作为发件人ID,而新的GCM使用API密钥。
Just tried an experiment myself, while using GCM to send messages to registration ids that were created by C2DM, I get the error 'MisMatchedSenderId'. This makes sense, since the older C2DM uses an email address as sender ID, while the new GCM uses an API key.
所以看起来两套注册ID的必须保持,直到所有的应用程序已经升级使用新的GCM。
So it looks like two sets of registration ids has to be maintained until all apps has been upgraded to use the new GCM.
这篇关于GCM发布通知,以现有的C2DM注册ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!