Android的GCM发送和MismatchSenderId [英] Android GCM send and MismatchSenderId

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

问题描述

奇怪的事情是,通知了之前的工作。所以,我不知道发生了什么。我尝试重新安装我的应用程序的设备,但没有改变。

<$p$p><$c$c>{\"multicast_id\":xxxxxxxxxxxxxxxxxxx,\"success\":0,\"failure\":1,\"canonical_ids\":0,\"results\":[{\"error\":\"MismatchSenderId\"}]}

由于这是在一个点的工作,我知道我使用的是正确的键。我根据我碰到其他SOF线程甚至三重检查。可能是什么潜在的问题呢?我现在已经四处张望了几天,我仍处于亏损状态。

**编辑**

下面是当从我的服务器发送出去的消息POST信息。

标题

 阵列

    [0] =&GT;授权:键= XXXXXXX键换浏览器的应用程序 - 从 - 谷歌API控制台-XXXXXXX
    [1] =&GT;内容类型:应用程序/ JSON

字段

 阵列

    [registration_ids] =&GT;排列
        (
            [0] =&GT; XXXXXXXXX-大的老-ID-来自该设备-XXXXXXXX    [数据] =&GT;排列
        (
            [消息] =&GT;你好
        ))

同时

我使用与于浏览器应用的关键(含参照网址)相关的关键


解决方案

显然,当你重新编译你的应用程序它有时会甩开设备ID生成到它不会匹配一个previous ID。

我所要做的就是我的手机上的应用程序完整卸载并重新编译应用程序(通过Eclipse)。这似乎很可怜,但它是最接近可行的解决方案我在那一刻..

The odd thing is that notifications were working before. So I'm not sure what happened. I tried reinstalling my app to the device, but nothing changed.

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

Because this was working at one point, I know I am using the correct keys. I even triple checked based on other SOF threads I came across. What could be the potential problem now? I've looked around for a few days now and I'm still at a loss..

** EDIT **

Here's the POST info when a message is sent out from my server.

Headers

Array
(
    [0] => Authorization: key=xxxxxxx-key-for-browser-apps-from-google-apis-console-xxxxxxx
    [1] => Content-Type: application/json
)

Fields

Array
(
    [registration_ids] => Array
        (
            [0] => xxxxxxxxx-big-old-id-from-the-device-xxxxxxxx

    [data] => Array
        (
            [message] => hello
        )

)

Also

I am using the key associated with Key for browser apps (with referers).

解决方案

Apparently, when you recompile your app it will sometimes throw off the device id generation to where it won't match a previous id.

What I have to do is a COMPLETE uninstall of the app on my phone and recompile the app again (via eclipse). This seems quite pathetic, but it's the closest to a workable solution I have at the moment..

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

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