使用GCM发送消息时,我始终得到响应'MismatchSenderId' [英] When sending messages using GCM, I keep getting the response 'MismatchSenderId'

查看:209
本文介绍了使用GCM发送消息时,我始终得到响应'MismatchSenderId'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GCM实施推送通知服务器。我发送了一封包含从Google API Console获取的发件人ID(应用程序密钥)的帖子请求,以及从GCM服务获得的注册ID。

I'm implementing a push notification server with GCM. I send a post request with a sender ID (application key) that I got from Google API Console, and a registration ID that I got from the GCM service.

已发布JSON包含一个注册ID。我总是得到相同的回应:

The posted JSON includes one registration ID. I always get the same response:

{
  "multicast_id":8546528660791862014,
  "success":0,
  "failure":1,
  "canonical_ids":0,
  "results":[
    {
      "error":"MismatchSenderId"
    }
  ]
}

可能是什么问题?我在做什么错了?

What might be the problem? What am I doing wrong?

推荐答案

请参阅堆栈溢出文章 为什么我从GCM服务器端收到MismatchSenderId?

See the Stack Overflow post Why do I get "MismatchSenderId" from GCM server side?.

p>

From the URL above:


仔细检查发件人ID和API_KEY,它们必须匹配,否则您将得到该MismatchSenderId错误。在Google API Console中,查看您项目的网址:


https://code.google.com/apis/console/#project:xxxxxxxxxxx


xxxxxxxxx是项目ID,它是发件人ID。

double check the Sender ID and API_KEY, they must match or else you will get that MismatchSenderId error. In the Google API Console, look at the URL of your project:

https://code.google.com/apis/console/#project:xxxxxxxxxxx

The xxxxxxxxx is the project ID, which is the sender ID.

有些人使用Key for Server Apps类型的键报告问题,但使用浏览器成功键类型。就我个人而言,服务器密钥类型适用于我,但请同时尝试使用YMMV。

Some people are reporting issues using the "Key for Server Apps" type of keys, but having success using the Browser Key type instead. Personally, the Server Key type works for me, but try both, YMMV.

这篇关于使用GCM发送消息时,我始终得到响应'MismatchSenderId'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆