1

我创建了一个使用 Google can 消息传递的应用程序,它运行良好。然后,我使用新的密钥库导出签名的应用程序。将其上传到 playstore 在发布页面上链接发件人 ID。我卸载了未签名的应用程序并从 Play 商店安装了新应用程序,但现在我无法接收消息。服务器控制台显示成功发送的消息以及 messageID,但设备上没有通知。

4

2 回答 2

1

检查您的清单文件。如果您可以在没有

android:protectionLevel=signature

您可能在权限对象中使用了不正确的包名称。检查您是否确实将包名称更改为您的应用程序包名称。

所以而不是:

<permission android:name="com.google.android.gcm.demo.app.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />
<uses-permission android:name="com.google.android.gcm.demo.app.permission.C2D_MESSAGE" />

利用:

<permission android:name="YOUR.PACKAGENAME.HERE.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />
<uses-permission android:name="YOUR.PACKAGENAME.HERE.permission.C2D_MESSAGE" />
于 2013-10-22T00:29:17.663 回答
0

奇怪的是,删除 android:protectionLevel=signature 标签解决了这个问题。我知道这意味着现在其他应用程序也可以获取我发送的通知。

于 2013-01-06T07:26:17.433 回答