tinycreative / react-native-intercom

React Native wrapper for Intercom.io
MIT License
405 stars 279 forks source link

unable to received push message from Intercom dashboard (with OneSignal) #388

Closed pentolbakso closed 4 years ago

pentolbakso commented 4 years ago

The issue is app unable to receive a notification if send from Intercom. Firebase server key etc etc are configured and tested. Notification well received if comes from OneSignal dashboard.

But i found something interesting when tailing my logcat

"OneSignal [D] Not a OneSignal formatted GCM message. No 'custom' field in the bundle."

I guess the OneSignal sdk is silently discard the Intercom's push notification. ref: https://github.com/OneSignal/OneSignal-Android-SDK/blob/master/OneSignalSDK/onesignal/src/main/java/com/onesignal/OSNotificationFormatHelper.java#L17

This issue probably is OneSignal's.. just want to let anyone know since I saw related issues in this repo.

Anyone has a working solution to solve this?

pentolbakso commented 4 years ago

Ok, I think I got it working now. Generally, similar steps to https://github.com/tinycreative/react-native-intercom/issues/307#issuecomment-588767603

The basic idea is to have multiple <receiver/> for notifications : OneSignal and Intercom. OneSignal SDK already handle it but we need to work on Intercom.

Also since I'm not using RNFirebase at all, just change this in MainMessagingService.java import io.invertase.firebase.messaging.RNFirebaseMessagingService; to import com.google.firebase.messaging.FirebaseMessagingService;