I'm trying to implement two 3rd party libraries (Parse & Localytics)
which uses GCM push
notifications but I can't seem to get both to work together. It's either one or the other that will work.
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</receiver>
<receiver android:name="com.localytics.android.PushReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</receiver>
GCM only is aware of your app, not the content of the GCM payload.
You need a common receiver that can parse the intent received for the particular data that identifies it as Localytics or Parse, then forward that intent to the appropriate receiver for either service.
GCM is based on "app registration" not on "app feature registration" - it will deliver to your app, not a particular receiver within your app.
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