gcmsender错误:MismatchSenderId [英] gcmsender error: MismatchSenderId

查看:237
本文介绍了gcmsender错误:MismatchSenderId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用其示例应用程序测试更新的Google gsm云服务 https://github.com/googlesamples/google-services/tree/master /android/gcm 我在这里关注谷歌教程: https://developers.google.com/cloud-messaging/android/start

I am testing the updated google gsm cloud services with their sample app https://github.com/googlesamples/google-services/tree/master/android/gcm and I am following google tutorial here: https://developers.google.com/cloud-messaging/android/start

设备客户端已设置,我正在接收令牌,并且已经在我的开发者控制台上下载并配置了google-services.json.

the device client is set up, I am receiving the token and I already have the google-services.json downloaded and configured on the my developer console.

我知道gcmsender模块使用了API密钥来发送测试消息,但是我收到了错误消息: 结果":[{错误":"MismatchSenderId"}]} 我已经确认google-services.json使用的是与开发者控制台提供给我的相同的发件人ID. 我想念什么?

I understand that the API key is used by the gcmsender module to send a test message, however I receive an error: "results":[{"error":"MismatchSenderId"}]} I have confirmed that the google-services.json is using the same sender id as was supplied to me by the developer console. What am I missing?

推荐答案

请在您的终端机中以以下脚本运行

Please run below script in your terminal

卷曲-X POST \
-H授权:密钥=在此处写api_key" \
-H内容类型:application/json" \
-d'{
"registration_ids":[在此处写入gcm生成的reg_id"],"data":{"message":来自Rajkumar的手动推送通知"}, 优先级":高"
}'\ https://android.googleapis.com/gcm/send

curl -X POST \
-H "Authorization: key= write here api_key" \
-H "Content-Type: application/json" \
-d '{
"registration_ids": [ "write here reg_id generated by gcm"], "data": { "message": "Manual push notification from Rajkumar" }, "priority": "high"
}' \ https://android.googleapis.com/gcm/send

MismatchSenderId,因为在同一设备中,您使用不同的密钥登录.要解决此问题,请卸载应用程序并再次运行g并更新注册密钥.然后在您在终端上运行的CURL脚本(我在其上面发布)会显示成功消息,并且您会收到通知到您的设备

MismatchSenderId because with in same device you have logged with different keys. to solve this problem uninstall app and run it againg and update the registration key. and then run the CURL script in your teminal which i post above it will give success message and you will get notification to your device

这篇关于gcmsender错误:MismatchSenderId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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