Everything works well on the IOS device but Android not, on Android device it still receives notification but when pressing the noti, then the app opens itself but onNotificationOpenedApp function is not run.
Package in used:
"@react-native-firebase/app": "^7.1.0",
"@react-native-firebase/messaging": "^7.1.0",
"react-native-push-notification": "^3.5.1",
"@react-native-community/push-notification-ios": "^1.2.0",
Hello, I had the same problem.
My problem was in SplashActivity file.
Do you use it?
I also had this problem and it was caused by the lib react-native-splash-screen as mentioned on this thread, because it receives the push Intent on Android, but do not pass it to the MainActivity.
If I understood right, this callback is just called when the app is on background state, not on foreground or in quit state, so to handle the notification on the quit state you will have to use the getInitialNotification, but for the foreground state I don't think there's a way to identify that the notification was tapped as someone also reported this problem
@Newbornbird Thanks, I solved this, so now I get a new problem that every time I push a new notification from firebase console the onNotificationOpenedApp function run automatically one time with no data. When I press the notification on the notification panel of the device it will run onNotificationOpenedApp function again with data. So how can I force first running this function when receiving notification from the firebase console?
same here:
"@react-native-firebase/analytics": "^7.1.0",
"@react-native-firebase/app": "^7.1.0",
"@react-native-firebase/auth": "^8.0.0",
"@react-native-firebase/crashlytics": "^7.1.0",
"@react-native-firebase/firestore": "^7.1.0",
"@react-native-firebase/messaging": "^7.1.1",
Any solution?
Dear @roni-castro
I am using react-native-splash-screen and facing this issue.
Can you confirm that by removing this package this issue will be solved?
@ghasemikasra39 https://github.com/crazycodeboy/react-native-splash-screen/issues/289#issuecomment-502406454
Feel free to continue the discussion, but this is not an issue/bug with React Native Firebase.
"@react-native-firebase/app": "^8.4.6",
"@react-native-firebase/messaging": "^7.9.1",
"react-native-push-notification": "^6.1.1",
"@react-native-community/push-notification-ios": "^1.6.1",
I see notification from Cloud Message in background, but onNotificationOpenedApp onMessage functions are not run in foreground
@ZaikinaEvgeniya-2 no comments here will receive attention. It's a closed issue nearly half a year, new issue with full template
Most helpful comment
I also had this problem and it was caused by the lib
react-native-splash-screenas mentioned on this thread, because it receives the push Intent on Android, but do not pass it to the MainActivity.If I understood right, this callback is just called when the app is on background state, not on foreground or in quit state, so to handle the notification on the quit state you will have to use the
getInitialNotification, but for theforegroundstate I don't think there's a way to identify that the notification was tapped as someone also reported this problem