Issue
I've seen that c2dm itself is deprecated. But the new method, Google Cloud Messaging, seems to send intents with com.google.android.c2dm.intent.RECEIVE as the action.
My code is using this to get the registration key:
gcm = GoogleCloudMessaging.getInstance(getApplicationContext());
gcm.register(SENDER_ID);
Things are arriving correctly, but I'm wondering if I've left something in a half-deprecated state.
Solution
Yes, com.google.android.c2dm.intent.RECEIVE
is still in use. It is used when receiving a broadcast from GCM server that contains a GCM message. Even though C2DM is long deprecated, GCM still uses some names that contain c2dm
.
As you can see in this manifest sample (taken from the GCM guide), there are multiple places that still use names containing c2dm
or C2D
:
<manifest package="com.example.gcm" ...>
...
<permission android:name="com.example.gcm.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />
<application ...>
<receiver
android:name=".GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.example.gcm" />
</intent-filter>
</receiver>
<service android:name=".GcmIntentService" />
</application>
Answered By - Eran
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.