OneSignal receiver in AndroidManifest causing push messages from Helpshift to not be received

We have recently integrated Helpshift into our apps. Initially I made a stand-alone test app to make sure I was using it properly, and push messages worked fine.

Then I integrated it into our apps, and suddenly the push messages stopped coming through on Android. I narrowed it down to our apps having this in the AndroidManifest.xml

\<activity android:name="com.onesignal.NotificationOpenedActivity"/\> \<receiver android:name="com.onesignal.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" \> \<intent-filter\> \<action android:name="com.google.android.c2dm.intent.RECEIVE" /\> \<category android:name="com.quiztix.mygame" /\> \</intent-filter\> \</receiver\> \<service android:name="com.onesignal.GcmIntentService" /\>

Am I right that this bit of code essentially says “only acknowledge a push message if it is sent to the One Signal activity”?

The Helpshift lib doesn’t have anything similar afaik (I’m waiting for a response about it), so it seems to be blocking their push messages. We still want to use OneSignal for our general push messages, but it’s helpful that their system sends another push message to notify the user that someone from the support team has replied to a message.

Hello,

In your stand-alone test app did you have both OneSiganl an Helpshift active and both working without issues?

Our \<receiver&nbsp;android:name="com.onesignal.GcmBroadcastReceiver"&nbsp;... is run then com.onesignal.GcmIntentService each time a GCM message is received from Google’s GCM server. It will end up being fired if a notification is sent from OneSignal or Helpshift. However we check to make sure the GCM message is in our format before processing the message.

It looks like Helpshift uses Corona’s built in notification receiver however this won’t work with OneSignal as we have disabled it (com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver) so notifications are not displayed twice. To work around this you will need to follow their Android native steps for notifications. However I don’t know if their Corona SDK differs much from the native one so you may have to just use their native SDK completely instead. I would provide this information to them and see what they suggest.

Also side note you should update the first line in your code snippet to the following. This prevents any flicker when opening or dismissing a OneSignal notification.

\<activity android:name="com.onesignal.NotificationOpenedActivity" android:theme="@android:style/Theme.NoDisplay"/\>

Thanks.

Thank you for replying so quickly.

In my stand alone app I only had Helpshift, I tend to test each new library I implement by itself before adding it to the main project with other libs.

I’ll get in touch with my contact at Helpshift and let him know about the built in notification receiver being disabled.

Thanks again.

Someone at Helpshift has asked:

“Can you please confirm with OneSignal if they send a device token, then you just need to do call registerDeviceToken with that token”

The IdsAvailableCallback function returns a player ID and push token, but when I try passing that in it does not work. Is there a separate push token at all? It’s not easy to tell whether this is the original push token, or a new one that OneSignal generates when disabling the Corona receiver.

The pushToken returned from IdsAvailableCallback is what they are asking, it is tied to the Google Project number and Google GCM server key however so you will need to use the same one for both services. This will allow Helpshift to send GCM messages to your app however nothing would be setup to display. This is because the Helpshift SDK is relying on com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver to display them but the OneSignal Corona SDK disables this.

Instead of requiring either Helpshift or you to setup something custom to work around we can build a filter proxy into our SDK to allow non-OneSignal message to still be processed by Corona.

Thanks.

Here is a OneSignal Beta Corona Enterprise build that will allow Helpshift (Or any other plugin that relies on the Corona GCM Receiver) and OneSignal to work together.

https://www.dropbox.com/s/tkdnuzd8pszl94r/OneSignal-1.10.4-beta-4.zip?dl=0

This requires you to add the following to your AndroidManifest.xml:

\<receiver android:name="com.onesignal.CoronaGCMFilterProxyReceiver" android:permission="com.google.android.c2dm.permission.SEND" \> \<intent-filter\> \<action android:name="com.google.android.c2dm.intent.RECEIVE" /\> \<category android:name="com.mycompany.app" /\> \</intent-filter\> \</receiver\>

You should then be able to follow Helpshift’s Corona Notification guide like normal.

Let us know if this works for you.

Thanks.

Thank you so much, I will test that when I get to my desk in a few hours and let you know if it works for me.
You guys are the best!

That worked perfectly. The only thing I’ll point out in case it causes you any problems, is that while you put the correct manifest code in your post here, the metadata.lua file is slightly different:

metadata.lua

 android:name="OneSiganl.CoronaGCMFilterProxyReceiver"

correct name in filter

android:name="com.onesignal.CoronaGCMFilterProxyReceiver"

Thank you again jkasten! I’ll let the guys at Helpshift know as well.

Good to hear that fixed it for you!

Good catch on that, I noticed it was wrong right after I posted the build actually too. I’ll make sure it gets into the final release build.

Thanks.

Hello,

In your stand-alone test app did you have both OneSiganl an Helpshift active and both working without issues?

Our \<receiver&nbsp;android:name="com.onesignal.GcmBroadcastReceiver"&nbsp;... is run then com.onesignal.GcmIntentService each time a GCM message is received from Google’s GCM server. It will end up being fired if a notification is sent from OneSignal or Helpshift. However we check to make sure the GCM message is in our format before processing the message.

It looks like Helpshift uses Corona’s built in notification receiver however this won’t work with OneSignal as we have disabled it (com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver) so notifications are not displayed twice. To work around this you will need to follow their Android native steps for notifications. However I don’t know if their Corona SDK differs much from the native one so you may have to just use their native SDK completely instead. I would provide this information to them and see what they suggest.

Also side note you should update the first line in your code snippet to the following. This prevents any flicker when opening or dismissing a OneSignal notification.

\<activity android:name="com.onesignal.NotificationOpenedActivity" android:theme="@android:style/Theme.NoDisplay"/\>

Thanks.

Thank you for replying so quickly.

In my stand alone app I only had Helpshift, I tend to test each new library I implement by itself before adding it to the main project with other libs.

I’ll get in touch with my contact at Helpshift and let him know about the built in notification receiver being disabled.

Thanks again.

Someone at Helpshift has asked:

“Can you please confirm with OneSignal if they send a device token, then you just need to do call registerDeviceToken with that token”

The IdsAvailableCallback function returns a player ID and push token, but when I try passing that in it does not work. Is there a separate push token at all? It’s not easy to tell whether this is the original push token, or a new one that OneSignal generates when disabling the Corona receiver.

The pushToken returned from IdsAvailableCallback is what they are asking, it is tied to the Google Project number and Google GCM server key however so you will need to use the same one for both services. This will allow Helpshift to send GCM messages to your app however nothing would be setup to display. This is because the Helpshift SDK is relying on com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver to display them but the OneSignal Corona SDK disables this.

Instead of requiring either Helpshift or you to setup something custom to work around we can build a filter proxy into our SDK to allow non-OneSignal message to still be processed by Corona.

Thanks.

Here is a OneSignal Beta Corona Enterprise build that will allow Helpshift (Or any other plugin that relies on the Corona GCM Receiver) and OneSignal to work together.

https://www.dropbox.com/s/tkdnuzd8pszl94r/OneSignal-1.10.4-beta-4.zip?dl=0

This requires you to add the following to your AndroidManifest.xml:

\<receiver android:name="com.onesignal.CoronaGCMFilterProxyReceiver" android:permission="com.google.android.c2dm.permission.SEND" \> \<intent-filter\> \<action android:name="com.google.android.c2dm.intent.RECEIVE" /\> \<category android:name="com.mycompany.app" /\> \</intent-filter\> \</receiver\>

You should then be able to follow Helpshift’s Corona Notification guide like normal.

Let us know if this works for you.

Thanks.

Thank you so much, I will test that when I get to my desk in a few hours and let you know if it works for me.
You guys are the best!

That worked perfectly. The only thing I’ll point out in case it causes you any problems, is that while you put the correct manifest code in your post here, the metadata.lua file is slightly different:

metadata.lua

 android:name="OneSiganl.CoronaGCMFilterProxyReceiver"

correct name in filter

android:name="com.onesignal.CoronaGCMFilterProxyReceiver"

Thank you again jkasten! I’ll let the guys at Helpshift know as well.

Good to hear that fixed it for you!

Good catch on that, I noticed it was wrong right after I posted the build actually too. I’ll make sure it gets into the final release build.

Thanks.