Lionel
Lionel

Reputation: 41

multiple push providers with parse.com

I have a product with an home made push provider. We try to add parse.com as a provider.

No problem with ios (os manage push, everything work with unity plugin).

But I'm very confused with android, I've tried many different things but I never had push from parse and our push with the same configuration. I integrate parse android plugin 1.8.3, add all datas in the manifest, modified Application class to init Parse, everything works well. Installation datas are sent to parse. I can send a push with dashboard, I have "This will be sent to 1 devices" but after sending it status is succeeded "0 pushes sent". No error, nothing append on device.

Where can I find why I target 1 device and why 0 push are sent ? Is it really possible to have 2 differents services which manage com.google.android.c2dm.intent.RECEIVE and com.google.android.c2dm.intent.REGISTRATION ?

manifest push parts :

<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
  <intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
    <action android:name="android.intent.action.USER_PRESENT" />
  </intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
  <intent-filter>
    <action android:name="com.parse.push.intent.RECEIVE" />
    <action android:name="com.parse.push.intent.DELETE" />
    <action android:name="com.parse.push.intent.OPEN" />
  </intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND">
  <intent-filter>
    <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
    <category android:name="bundleId" />
  </intent-filter>
</receiver>

<!-- GCM homemade notifications -->
<service android:name="com.homemade.unityApp.notifications.UnityGCMReceiverService" />
<receiver android:name="com.homemade.unityApp.notifications.UnityGCMCustomBroadcastReceiver" 
        android:permission="com.google.android.c2dm.permission.SEND">
  <intent-filter>
    <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
    <category android:name="bundleId" />
  </intent-filter>
</receiver>

Upvotes: 1

Views: 822

Answers (2)

Lionel
Lionel

Reputation: 41

I found the solution, I've added several times without any success. I've tried to add senderId in java code when sending installation datas and it work. I really don't know why just add meta didn't work, maybe I've missed something.

So the original manifest is ok, parsegcmbroadcaster seems to correctly filtering notifications.

Upvotes: 0

Budius
Budius

Reputation: 39836

yes it is possible to have two push on the same app

you must setup on manifest the permission and users-permission as described on the official guide https://developer.android.com/google/gcm/client.html

and have two receive on the manifest with the appropriate intent-filter both SDK must register the push. An example is the app I work on, we have:

GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String regid = gcm.register(GCMID);

and

Localytics.registerPush(GCMID);

one from our own server and one from localytics push. I believe parse.com will have it's on registerPush method.

On those case both BroadcastReceiver will receive the message, so it's kind of necessary to put a token in the push message to filter which of them should ignore the message and which should act on it.

Upvotes: 1

Related Questions