问题描述
我似乎被卡住的试图找出什么不顺心的消费小时。这种感觉,因为我完全误解的东西。因此,这里的事:
I seem to be stuck spending hours of trying to figure out what goes wrong. It feels as I am misunderstanding something entirely. So here's the thing:
虽然试图使C2DM工作中,我第一次用专用的电子邮件地址签署了在谷歌的C2DM服务。这是一个我想用从服务器到客户端发送消息。然后,我添加code到客户端应用程序,并注册C2DM设备。所获得的注册ID发送到服务器,并存储在DB中。
While trying to make C2DM work, I 1st signed up at Google's C2DM service with a dedicated email adress. That's the one I want to use to send messages from the server to the clients. Then I added code to the client app and registered the device for C2DM. The obtained registration id is sent to the server and stored in the db.
当我尝试(如果我使用无论卷曲
或PHP)将消息发送到设备的问题出现了。发送考虑到我以前好感的C2DM服务第一名完美的作品。然而,发送给任何其他设备失败,
。我只是不明白为什么。我使用从注册帐户
错误= NotRegistered AUTH键
和注册ID
,我从客户创造。我(重新)-created的注册ID
像几百次,但根据谷歌code页
表示
错误= NotRegistered registration_id
是无效的。
The problem arises when I try to send messages (no matter if I use curl
or php) to the devices. Sending to account that I used to signup to the C2DM service in the 1st place works flawlessly. However, sending to any other device fails with Error=NotRegistered
. And I just don't get why. I am using the auth key
from the signup account and the registration id
that I create from the clients. I've (re)-created the registration id
like hundreds of times but according to the google code page Error=NotRegistered
means that the registration_id
is not valid.
的澄清的尝试:的
的我能够很好地将消息发送到链接到我用于注册到C2DM的谷歌帐户的注册ID。将消息发送到不同的注册ID的其他所有尝试都失败了。所以,我基本上可以将邮件发送到一个单一的注册ID。的
的也许我应该检查我的C2DM的理解:在服务器仅限于将消息发送到一台设备?我以为服务器可以将邮件发送到每个提交设备的注册ID ... 的
我缺少/误解?
太感谢了,Steff
Thanks a million, Steff
推荐答案
有没有哪些设备将其发送到限制。更重要的可能是,你发送给注册ID是错误的,或者你发送给该设备还没有注册成功。
There's no limitation on which devices it sends to. What's more likely is that the registration ID you're sending to is wrong, or the device you're sending to has not successfully registered.
我会建议双重检查的注册ID,测试另一台设备上,如果可以的话,请确保在您提交的消息,谷歌的服务器,你得到一个200响应,并确认设备肯定成功注册接收C2DM的消息
I would suggest double checking the registration ID, test on another device if you can, make sure when you submit the message to Google's servers you are getting a 200 response, and confirm that the devices are definitely successfully registering to receive C2DM messages.
我建议你阅读过本。这是对C2DM最好的教程我见过。
I'd suggest reading this too. It's the best tutorial on C2DM I've seen.http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html
这篇关于C2DM:只有注册谷歌帐号从服务器接收邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!