0

I'm using GCM to send notifications, everything work correctly. I tried to create a GCM library, so I can integrate GCM in my future android apps easily. I created a project containing everything I need to show the notifications, and mark it as a library. When I execute the application, it gets the registration id and everything seems to work, but no notification is shown.

Using the filter Tag:GCM in LogCat I get the following :

04-29 15:24:33.937: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.REGISTRATION
04-29 15:24:33.937: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:33.937: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.195: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.195: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.195: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.242: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.242: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.242: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.320: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.320: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.320: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.398: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.398: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.398: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.453: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.460: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.460: V/GCMBaseIntentService(19334): Acquiring wakelock

PS : when I use GCM in the simple way, I have in Logcat more lines like : releasing wakelock thanks

Dave Newman
  • 1,018
  • 10
  • 15
user2332601
  • 1
  • 1
  • 2

1 Answers1

0

Strange but the solution given here worked for me. Double check your manifest file and verify if the broadcast receiver/intent service tag and the actual service class names match. Finally try to put the GCM intent service class and its parent activity in the same package.

Community
  • 1
  • 1