Closed PallabJS closed 1 month ago
Try sending the push notification directly from firebase. Usually the issue I've seen is that the push notification doesn't appear when the app is running, not the other way around.
Yes, the push notification won't appear when App is in Foreground, that is a separate thing from what I am facing.
Sending push notification from firebase works as it add notification
field to the payload.
But when sending a push notification from Salesforce MobilePush service, the payload won't include the notification
field, and firebase background handler seems to ignore it as a data-only only type notification, hence notification is not displayed.
I needed a work around for this particular case.
What does your javascript code look like? Are you following the instructions on how to set the push token as per https://github.com/allboatsrise/expo-marketingcloudsdk/blob/c3b465b99dd4750669b3cd45983f690b5890a67d/README.md?plain=1#L41-L93 ?
Not sure what workaround you're referring to, push notifications work just fine on iOS/Android with this expo plugin. Make sure you have latest expo, expo-notification
packages. Etc.
Solved this issue by completely removing @react-native-firebase/messaging
from the project.
Using multiple notification handling services caused the incoming notification at KILLED state to be handled by firebase which treats data-only notification as silent/no-show notification.
Makes sense, good work!
When push notification is sent from MarketingCloud - MobilePush, Notification is not displayed when app is at closed or Quit state. I found out that Salesforce is not sending
notification
part in the notification payload, instead it's sendingdata
, which might be getting ignore by the firebase notification handler.And looks like there is no way to configure the payload at MobilePush service to include
notification
object. Found a thread that exactly matches the current scenario -> https://salesforce.stackexchange.com/questions/330974/android-mobile-push-via-marketingcloudsdk-not-receivedAfter going through the code I observed that the troubleshoot fix step is already added in the code.
But still I am not able to see notification when App is in KILLED state.
FYI: In all other cases, notification works perfectly fine.
Any Ideas?