The onRegistered method never gets called, in the logcat I see the last line as acquiring wakelock.
- 09-26 14:03:23.285: D/GCMRegistrar(15820): resetting backoff for
- 09-26 14:03:23.285: V/GCMRegistrar(15820): Registering app *a of senders 735175912799
- 09-26 14:03:23.895: V/GCMBroadcastReceiver(15820): onReceive: - com.google.android.c2dm.intent.REGISTRATION 09-26 14:03:23.895: V/GCMRegistrar(15820): Setting the name of retry receiver class to *.notifications.MyGCMBroadcastReceiver
- 09-26 14:03:23.895: V/GCMBroadcastReceiver(15820): GCM IntentService class: - *.notifications.GCMIntentService
- 09-26 14:03:23.903: V/GCMBaseIntentService(15820): Acquiring wakelock
I have my own Broadcastreceiver:
import com.google.android.gcm.GCMBroadcastReceiver;
public class MyGCMBroadcastReceiver extends GCMBroadcastReceiver {
@Override
protected String getGCMIntentServiceClassName (Context context) {
return GCMIntentService.class.getCanonicalName();
}
}
I had similiar problem. It turned out that I forgot to add to ApplicationManifest.xml:
<service android:name=".GCMIntentService"/>
Following are common solutions:
1) Name you service as "GCMIntentService"
2) Put your GCMIntentService
in default package
3) before sending GCM register request call
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
So that if there is any problem with your device or menifest it will tell you. 4) check permissions. Particularly check package mane in permissions. This is a nesty on, if you mess up with package name in permission, it will work for latest androids(Jelly Bean +) but will fail in lower devices
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With