简体   繁体   English

GCM推送通知仅适用于Debug apk

[英]GCM Push Notification only works with Debug apk

I have gotten reports that my app does not send or receive notifications from users. 我收到报告说我的应用程序不发送或接收来自用户的通知。 When I run the app from Android Studio and send a notification to one of my devices that also has a debug version of the apk, I noticed it works fine. 当我从Android Studio运行该应用程序并将通知发送到也具有apk调试版本的设备之一时,我注意到它运行良好。 Both devices can receive and send notifications as expected. 两种设备都可以按预期接收和发送通知。 However when I try to run the same test with versions of the app from the Play Store, no notifications are sent or received. 但是,当我尝试使用Play商店中的应用版本运行相同的测试时,不会发送或接收任何通知。 I have debugged this and found out that if I am trying to send a notification to a phone that has the Play Store version from a phone that has a debug version, the data sends but the phone with the debug version of the app does not receive the notification. 我已对此进行调试,发现如果我尝试从具有调试版本的手机向具有Play商店版本的手机发送通知,则会发送数据,但带有该应用程序的调试版本的手机不会收到通知。 Why is this and how do I fix? 为什么会这样,我该如何解决?

The version on Play Store and your debug version are signed with different keys (as you cannot upload an app signed with a debug key to Play Store), and probably this is the case. Play商店上的版本和调试版本使用不同的密钥签名(因为您无法将使用调试密钥签名的应用上传到Play商店),可能就是这种情况。 You have to pass your public release key fingerprint to google so that they can recognize your app and transfer messages. 您必须将公开发布密钥指纹传递给Google,这样他们才能识别您的应用并传输消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM