-
Notifications
You must be signed in to change notification settings - Fork 31
notifee + react-native-firebase: no notification shown #120
Comments
I believe this is a few issues at once
|
I have a chat application. When I close the app on one device and send a message to this device from another device, a notification should popup. Expected behaviour: Observed behaviour: I do not change the state of the app on both devices during the test. EDIT: when the app is open on the receiving device (the device where the notifications should appear), every notification is shown (so it works). But when the app is in background mode/closed, the first/first 2 notifications fail. |
Hi, sorry about the problems you're facing with the notifications. I have a few questions:
|
Update. I'm sorry for the delay, was busy working on another project. I changed my build scheme from debug to release in XCode, and all notifications are received now. When the build scheme is in debug, all notifications are received when the app is open, but not when the app is in background state/closed. Then, a lot of the notifications just don't arrive. Is this because the app is in debug mode? |
@yesterday24 I think you may be running in to an issue I can generally summarize as "the react-native-firebase native module attempts to send events to the javascript bundle before it's loaded". My hunch is based on release (which is optimized and faster to load and start executed) vs debug, so debug loses the "race" and release works. Related PR: invertase/react-native-firebase#4144 Note another PR recently as well targets background (not closed) state that may have this symptom: invertase/react-native-firebase#4180 If you were not re-testing against the most up to date version you may not have those - messaging@7.8.4 or higher |
@mikehardy from other issues you have commented on, in the react-native firebase repo, I finally had a closer look at |
I just had a look and you're right. Seems like each of the examples that send data-only json could use an ios chunk with content available, yes? If I recall correctly each docs page has an edit button to propose a quick PR, the github workflow for PRs makes it a trivial thing, if you could put them in where you think they would have helped you we can merge it and spare future devs the frustration! |
@mikehardy done |
I'm trying to integrate notifee with react-native-firebase (messaging).
My code so far:
I hear a sound when a notification arrives, but the notification (notifee.displayNotification) is never shown.
When I leave out the JSON.parse-stuff and just 'hard code' a title and body, it works. But it seems like the JSON.parse-function is blocking (?) something.
Even the if/else-statement is not working as expected. I always hear a sound, but the notification is shown only like 10% of the total. When I leave out everything except for a notifee.displayNotification with a hardcoded title and body, it works, but as soon as I add more logic, it fails.
Edit:
I had it working for a couple times, I could even add some more code logic, but then it stopped working again. I hear a sound so a notification arrives, but only 5-10% of the notifications are actually shown on the screen.
The text was updated successfully, but these errors were encountered: