Cedric Beust Cedric Beust - 2 months ago 25
Android Question

Is com.google.android.c2dm.intent.REGISTRATION deprecated?

Short version: is the intent

com.google.android.c2dm.intent.REGISTRATION
still used at all or has it been completely deprecated by GCM?

Longer version: Google's
gcm-demo-client
declares this intent in its filter, however, if I follow the same procedure, I get a valid registration id when I call
gcm.register()
and then, my broadcast receiver receives an additional registration id because of the REGISTRATION filter, and this second registration id is bogus (I can't send any notification to it).

At this point, I'm considering removing the
REGISTRATION
filter (and keeping just
RECEIVE
) but I want to make sure I'm not missing something important in the protocol.

Answer

You are probably looking at an older version of the official Google demo. The current version doesn't use com.google.android.c2dm.intent.REGISTRATION, as you can see here:

    <receiver
        android:name=".GcmBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <!-- Receives the actual messages. -->
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <category android:name="com.google.android.gcm.demo.app" />
        </intent-filter>
    </receiver>