1
votes

onRegisterd() method from GCMIntentService not called.

In log it displays like: onReceive: com.google.android.c2dm.intent.REGISTRATION GCM IntentService class: com.example.dailysales.GCMIntentService Acquiring wakelock My AndroidManifest.XML File code is below:

<receiver
        android:name="com.google.android.gcm.GCMBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>

            <!-- Receives the actual messages. -->
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <!-- Receives the registration id. -->
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

            <category android:name="com.example.dailysales" />
        </intent-filter>
    </receiver>

    <service android:name="com.example.dailysales.backgroundservice.InboxMessageLoadingService" >
    </service>
    <service
        android:name=".GCMIntentService"
        android:enabled="true" >
    </service>
1

1 Answers

1
votes

This answer might help you: https://stackoverflow.com/a/18598887/4195406

You are using the com.google.android.gcm.GCMBroadcastReceiver broadcast receiver from the Google GCM client library. This class expects the intent service to be in the main package of your app.

You should either move the GCMIntentService to the main package of your app, or override GCMBroadcastReceiver.