setBackgroundMessageHandler behaviour appears inconsistent with docs #4946
Unanswered
jamie-unmind
asked this question in
Q&A
Replies: 1 comment 6 replies
-
The FCM payload you are sending appears to be mixed (contains both notification and data chunks) I believe for mixed payloads, the notification chunk is the important part, and it means that the firebase-ios-sdk / firebase-android-sdk will handle it and should post a device-local notification without ever giving control to your code - no handlers called If/when the user interacts with the device-local notification in a way that opens your app, I believe that you will see it as an initial notification? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
We are using
@react-native-firebase/messaging
10.8.0 to send Notification+Data messages for iOS and Android.According to the docs here,
setBackgroundMessageHandler
should be called when the application is in a Background or Quit state. However, we are experiencing some behaviour that is inconsistent with this.When the application is backgrounded:
contentAvailable: true
in theapns
section of the message in order to trigger `setBackgroundMessageHandler. The docs seems to suggest this should only be the case for Data only messages?When the application is quit (ie: user swipes it away):
priority: "high"
in theandroid
section of the message in order to trigger `setBackgroundMessageHandler. The docs seems to suggest this should only be the case for Data only messages?setBackgroundMessageHandler
appears to never be triggered. This issue comment seems to suggest that once an iOS app is swiped away,setBackgroundMessageHandler
cannot be triggered. However, this matrix in the docs suggests thatsetBackgroundMessageHandler
can be called in a Quit state, where Quit is defined as "When the device is locked or application is not active or running. The user can quit an app by "swiping it away" via the app switcher UI on the device." (source here). Is it possible to clarify which is the expected behaviour?Let me know if you need any more background info.
Beta Was this translation helpful? Give feedback.
All reactions