我正在使用Pushwoosh在本机Android应用程序上实现推送通知。
我已跟踪此链接:http://www.pushwoosh.com/programming-push-notification/android/native-android-sdk-integration/
运行我的应用程序时,我收到以下调试消息:
10-09 10:09:16.529: W/DeviceRegistrar(16545): Try To Registered for pushes
10-09 10:09:16.534: W/PushWoosh DeviceFeature2_5(16545): Try To sent AppOpen
10-09 10:09:17.749: W/PushWoosh: NetworkUtils(16545): PushWooshResult: {"status_code":200,"status_message":"OK","response":null}
10-09 10:09:17.749: V/GCMRegistrar(16545): Setting registered on server status as: true
10-09 10:09:17.754: W/PushWoosh: NetworkUtils(16545): PushWooshResult: {"status_code":200,"status_message":"OK","response":null}
10-09 10:09:17.754: W/PushWoosh DeviceFeature2_5(16545): Send AppOpen success
10-09 10:09:17.754: W/PushEventsTransmitter(16545): No android.permission.BROADCAST_STICKY. Reverting to simple broadcast
10-09 10:09:17.774: W/DeviceRegistrar(16545): Registered for pushes: APA91bEq5ihxMX7cr-qE1RLCEKF_mZf9PBGpNxerm3OhKnwk9iAnuGjDYkn3x-XR93OHJbYFOCayF7C-Q...
如您所见,一切似乎都正常(即设备已注册为接收推送消息)。
之后,我进入https://cp.pushwoosh.com/applications/01234-56789
然后,我键入一条消息,然后单击“哇!”。
推送已发送,但我的设备上什么也没有。
另外,当我转到https://code.google.com/apis/console/#project:0123456789:stats时,我看不到任何数据。它显示“总请求数:0”。它不应该显示大于0的数字吗?
我究竟做错了什么?为什么我没有收到我创建的推送?
更新:我正在使用在这里找到的最新的Pushwoosh.jar:https://github.com/shaders/push-notifications-sdk/tree/master/SDK/Android
最佳答案
我终于找到了问题。防火墙阻止了GCM使用的端口!
有关更多信息,请查看此帖子:Which port and protocol does Google Cloud Messaging (GCM) use?
希望它能对某人有所帮助! :)
关于android - Pushwoosh/GCM-Android-未收到消息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19258841/