我遇到了一些奇怪的事情,我正在开发一个使用Google GCM向用户发送通知的应用程序。设备没有收到来自Google GCM的消息
一切都很好,直到几天,重新启动我的设备出厂设置。该设备配置正确,因为我每天都在使用它,并且所有服务都“正常”运行。
现在我继续开发,但发送这些消息到设备失败。
当向GCM Google API发送消息时,这不表示任何错误。有趣的是,应用程序没有改变,并且这在另一个设备上正常工作。受影响的设备是Galaxy ACE(GT-5830i),另一款设备是Galaxy SIII,即使使用仿真器(Google API 2.3.3),该工作也没有任何问题。
我不知道为什么,这是与
GCM logcat的
07-17 10:31:59.429: D/GCMRegistrar(21586): resetting backoff for co.com.rkmax.example
07-17 10:31:59.437: V/GCMRegistrar(21586): Registering app co.com.rkmax.example of senders 123456789012
07-17 10:32:01.203: V/GCMBroadcastReceiver(21586): onReceive: com.google.android.c2dm.intent.REGISTRATION
07-17 10:32:01.203: V/GCMRegistrar(21586): Setting the name of retry receiver class to co.com.rkmax.example.receivers.GoogleCMReceiver
07-17 10:32:01.203: V/GCMBroadcastReceiver(21586): GCM IntentService class: co.com.rkmax.example.services.ReceiverGCMService
07-17 10:32:01.210: V/GCMBaseIntentService(21586): Acquiring wakelock
07-17 10:32:01.218: V/GCMBaseIntentService(21586): Intent service name: GCMIntentService-123456789012-1
07-17 10:32:01.226: V/GCMRegistrar(21586): Registering receiver
07-17 10:32:01.226: D/GCMRegistrar(21586): resetting backoff for co.com.rkmax.example
07-17 10:32:01.234: V/GCMRegistrar(21586): Saving regId on app version 7
07-17 10:32:01.382: V/GCMBaseIntentService(21586): Releasing wakelock
更新
我使用的方法GCMRegistrar.unregister
并重新注册该设备发生的事情,现在如果它的作品!
添加标签:在GCM登录猫,并检查来自GCM的日志,并粘贴它与你的问题 – Nargis
@Nargis显示更新,应用程序工作正常(注册设备并发送REGID到我的服务器),但没有收到消息时发送 – rkmax