我今天正在测试如何使用 gcm。它工作正常,但我收到双重通知。
我所说的双重通知是在通知发出几分钟后,第二个通知的内容与第一个完全相同。
我正在使用GCM 和 PHP (Google Cloud Messaging)测试通知
我不知道我哪里出错了。我正在使用模拟器和真实设备进行测试这是 logcat 调试
02-27 16:05:36.192: V/GCMBroadcastReceiver(513): onReceive: com.google.android.c2dm.intent.RECEIVE
02-27 16:05:36.192: V/GCMBroadcastReceiver(513): GCM IntentService class: mypackage.GCMIntentService
02-27 16:05:36.201: V/GCMBaseIntentService(513): Acquiring wakelock
02-27 16:05:36.221: V/GCMBaseIntentService(513): Intent service name: GCMIntentService-DynamicSenderIds-2
02-27 16:05:36.312: V/GCMBaseIntentService(513): Releasing wakelock
.
.
.
02-27 16:11:14.282: V/GCMBroadcastReceiver(513): onReceive: com.google.android.c2dm.intent.RECEIVE
02-27 16:11:14.282: V/GCMBroadcastReceiver(513): GCM IntentService class: mypackage.GCMIntentService
02-27 16:11:14.291: V/GCMBaseIntentService(513): Acquiring wakelock
02-27 16:11:14.302: V/GCMBaseIntentService(513): Intent service name: GCMIntentService-DynamicSenderIds-3
02-27 16:11:14.402: V/GCMBaseIntentService(513): Releasing wakelock