我正在使用Android Push Notifications using Google Cloud Messaging (GCM)在我的应用程序中实现GCM,当我尝试使用另一台设备(Galaxy S)
对其生成错误进行测试时,它在单个设备( Galaxy Tab 7')
上运行良好。
这是我得到的日志
V/GCMRegistrar(5649): Registering app my_maypackage of senders APA91bHvzZbO_nyYvaA_QRGDaV-wRAYKjt0qJSQmzPUi2unqG7j0OGuyhVY1A3zh-ZfnA0XT0ffgyKypVJ_5owLZvZBNGARpTBkBg9ED8gVVCDejaIpShghq_tXGhMnFQEufwdCL1ibm
V/GCMRegistrar(5649): Setting registeredOnServer status as true until 2013-04-02 11:02:07.847
V/GCMBroadcastReceiver(5649): onReceive: com.google.android.c2dm.intent.REGISTRATION
V/GCMBroadcastReceiver(5649): GCM IntentService class: my_maypackage.GCMIntentService
V/GCMBaseIntentService(5649): Acquiring wakelock
V/GCMBaseIntentService(5649): Intent service name: GCMIntentService-980172650021-7
D/GCMBaseIntentService(5649): handleRegistration: registrationId = null, error = INVALID_SENDER, unregistered = null
D/GCMBaseIntentService(5649): Registration error: INVALID_SENDER
I/GCMIntentService(5649): Received error: INVALID_SENDER
V/GCMBaseIntentService(5649): Releasing wakelock
注意:两个设备都配置了相同的gmail帐户。
最佳答案
日志显示不正确的发件人ID。它应取自Google api项目网址。例如
https://code.google.com/apis/console/b/0/#project:65464654646546
那么65464654646546是发件人ID。