【发布时间】:2015-04-04 07:58:16
【问题描述】:
我想向我的应用程序发送推送通知。我的后端已准备就绪,我也能够从服务器接收 gcm 注册 ID,但我无法在我的设备上接收通知。任何人都可以帮助我。是否需要从 Play 商店下载应用程序才能发送通知,或者我们也可以在调试 apk 中测试通知?
我通过下面给出的链接实现了推送通知: http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/
【问题讨论】:
-
你收到
Unauthorized Error 401了吗?如果 Google API 密钥错误或IP address of the server机器未在 Google GCM 服务器上列入白名单。然后你会得到。此外,在该示例中,传递的数据必须是JSON array。 -
我没有使用服务器密钥,而是在 api 控制台中使用浏览器密钥。
-
你可以查看官方文档here获得一些想法
标签: android android-studio push-notification google-cloud-messaging