为什么我会收到“302 Moved”来自 C2DM 服务器?
在使用 Android 云到设备消息传递时,我的应用程序成功从 ClientLogin 获取注册 ID,并成功注册以接收推送通知。但是,当我尝试向 C2DM 服务器发送推送通知以发送到设备时,我收到“302 Moved”。我发布的网址是 https://android.apis.google.com/c2dm/send
我收到了一封来自 Google 的电子邮件(48 小时前),其中说明了该帐户: “已添加到我们允许的发件人列表中,您应该能够在接下来的时间内开始使用它向 Android 2.2 设备发送消息 大约一天左右”
那是两天前的事,所以我假设它已经启动并正在运行。302 是否意味着帐户尚未设置,URL 已移动,还是其他什么?
谷歌真的不会让这些事情变得容易他们做的。
In using Android Cloud to Device Messaging my app successfully acquires a registration ID from ClientLogin, and successfully registers to receive push notifications. But when I attempt to send a push notification to the C2DM servers to be sent to a device, I get a "302 Moved". The URL I'm posting to is https://android.apis.google.com/c2dm/send
I have had an email (48hrs ago) from Google saying the account:
"has been added to our list of allowed senders, and you should be able to start using it to send messages to Android 2.2 devices within the next
day or so"
That was two days ago, so I assume it's up and running. Does the 302 mean the account hasn't been set up, that the URL has moved, or something else?
Google really don't make these things easy do they.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现从 ClientLogin 获取授权码的方式存在错误。我没有正确解析来自 ClientLogin 的响应。
对于面临此错误的其他人 - 如果您的 C2DM 身份验证不起作用,则可能会发生此错误,因此请检查您的身份验证代码。
I found a bug in the way I was acquiring the auth code from ClientLogin. I was not correctly parsing the response from ClientLogin.
For anyone else facing this error - it can occur if your C2DM authentication is not working, so check your auth code.