Android C2DM 服务器发送错误

发布于 2024-12-23 07:35:37 字数 198 浏览 4 评论 0原文

我使用 PHP 代码编写第三个服务器,我可以获得 deviceRegistrationId 和 authToken,但现在我收到“未经授权的错误 401”,这是我使用的 PHP 代码。 C2DM实现PHP代码

I used PHP code to write the 3rd servers ,I can get the deviceRegistrationId and authToken, but now I receive "Unauthorized Error 401",here is the PHP code which I used. C2DM implementation PHP code

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

桜花祭 2024-12-30 07:35:37

未经授权错误 401 表示用于验证发件人的 ClientLogin AUTH_TOKEN 无效。请确保您将正确的 ClientLogin 发送到 google 服务器。

Unauthorized Error 401 indicates that the ClientLogin AUTH_TOKEN used to validate the sender is invalid. Please make sure you are sending the correct ClientLogin to the google server.

还在原地等你 2024-12-30 07:35:37

任何客户端都会经历以下循环:

  1. 从站点的 IP 名称(不带前导的站点 URL)获取 IP 地址
    'http://')。此查找(IP 名称到 IP 地址的转换)由域名服务器 (DNS) 提供。
  2. 打开到该 IP 地址的 IP 套接字连接。
  3. 通过该套接字写入 HTTP 数据流。
  4. 接收从 Web 服务器返回的 HTTP 数据流作为响应。该数据流包含状态代码,其值由 HTTP 协议确定。解析此数据流以获取状态代码和其他有用信息。
  5. 当客户端收到它识别为“401”的 HTTP 状态代码时,会在上述最后一步中发生此错误。

Any client goes through the following cycle:

  1. Obtain an IP address from the IP name of the site (the site URL without the leading
    'http://'). This lookup (conversion of IP name to IP address) is provided by domain name servers (DNSs).
  2. Open an IP socket connection to that IP address.
  3. Write an HTTP data stream through that socket.
  4. Receive an HTTP data stream back from the Web server in response. This data stream contains status codes whose values are determined by the HTTP protocol. Parse this data stream for status codes and other useful information.
  5. This error occurs in the final step above when the client receives an HTTP status code it recognises as '401'.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文