-
Notifications
You must be signed in to change notification settings - Fork 2.3k
onNotification not triggered when app is in background - but heads up notification works fine #1222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Actually I added onMessage and onNotificationDisplayed and it seems when app is in background none of these callbacks are fired when app is in background. |
Have spoken with @vvusts on discord to clarify this issue. |
I have similar issue, but in my case I schedule local notifications, with no payload, and have to increase app icon badge while app is in background. And as in @vvusts case none of the callbacks is being called in background. |
i also got this, notification even with onNotification//.onMessage((message: RemoteMessage) => {console.log()}); empty values notifications gots triggered without onNotification function. |
I am seeing this issue too, This seems to be happening on iOS and Android. |
For me onMessage is triggered in background on android but not on ios. |
@vvusts neither onMessage nor onNotification is getting triggered for me. Can you please suggest how you made it working? |
@NarendraSingh88 if you didn't check once more installation documentation. |
i got it working on android (as @vvusts noted) onMessage() and manual notification display background/foreground. i have left onNotification() asside. |
@vvusts onNotification is getting triggered, but only when app is in foreground, but I am stuck for managing it in case of background. Though, the default status bar notification gets displayed in the background, but I need to navigate it to the specific screen on tapping / clicking the notification, and for that I need some callback like onNotification / onMessage in background as well, similar to foreground. Everything is working well, in foreground mode. The issue, I am facing is specifically in the background mode. |
Did anyone find the solution? I am facing exactly the same issue as @NarendraSingh88 |
Hello All , Foreground and Background notification working perfectly in Android. but notification received when app in foreground in IOS but notification did not receive when app in background. is this issue still exist in IOS? any solution ? |
|
@laukaichung background is working in iOS when you listen for onOpen callback |
Hello All , |
Same issue here |
@chrisbianca any update on this? Still happening... |
I have same problem. onNotification is triggered on android but not work on ios. Any help? |
I have also the same problem on iOS. When the app is foreground, both onNotification and onNotificaitonDisplayed events are triggered, however when the app is background & killed neither of the events are triggered. I'm using the versions below. Any help would be really appreciated. |
@petrucci53 that's just the way iOS works. You kill the app it's dead. I think the google docs have a table that shows all of this? |
I am facing same issue. When i send notification on iOS it triggers
podfile
APNs certificates added on firebase settings as well. Nothing seems to work. |
@mikehardy
|
@deepankarsandy there is all sorts of setup you need to do. it's all documented on rnfirebase.io though. You also have to be careful of interactions with other modules default setup guides e.g. (code included): crazycodeboy/react-native-splash-screen#289 |
Thank you @mikehardy. It's |
I have issue on both platforms.
I am using react native 52.1 and latest version of RN firebase.
I can show heads up notification on both OS (push or scheduled notifications) when app is in background, killed and when app is in foreground onNotification is triggered so I make some other action in that case (like show alert and not heads up notification).
My problem is I need to increase app icon badge when get notification.
But I can't do that as
onNotification
is not triggered when app is in background.So I see notification banner but callback itself was not called.
My payload:
The text was updated successfully, but these errors were encountered: