Reputation: 1163
When we implement GCM(Google cloud messaging) in android we have to give our receiver in every application. according to my knowledge if you have multiple app having its own receiver mapped for common action "com.google.android.c2dm.intent.RECEIVE"
. Receiver inside every application should call but not, I want to know how android identify that which application's receiver should call ?
<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>
Upvotes: 1
Views: 799
Reputation: 393791
When you specify your package name in the category
of the intent filter of the GCM broadcast receiver, you narrow down the scope of the com.google.android.c2dm.intent.RECEIVE
action to the specific application that the GCM message should be delivered to.
Upvotes: 1