0

您好,我想发送 C2DM 消息。要接收消息,我使用从http://code.google.com/p/chrometophone/source/checkout下载的 Chrome to Phone 应用程序 在那里我将发件人 ID 更改为另一个我用来注册此应用程序的 gmail ID (用于发送消息的角色帐户)。并且还使用我从上面下载的 android 代码获取同一邮件 ID 的身份验证令牌和注册 ID。但是当我使用 curl 发送 c2dm 消息时,如下所示,它返回 401 错误并显示未授权。有人可以帮助我指出我在哪里做错了。

curl --header "Authorization: GoogleLogin auth=**authFromRegistrationAbove**" "https://android.apis.google.com/c2dm/send" -d registration_id=**phoneRegistrationId(reciever)** -d "data.message=Hello" -d collapse_key=message -k
4

1 回答 1

0

Your server needs authorization. Have you registered yourself with Google? You need to sign up with them to receive registration IDs when a user logs into his/her device.

Here is that error code from the docs: 401 Indicates that the ClientLogin AUTH_TOKEN used to validate the sender is invalid.

于 2011-01-28T20:27:08.067 回答