[iOS] notification action does nothing if app is killed
Issue
In iOS if you kill the app and then click on a notification action the notification action is not delivered to the JS side since JS bridge is not ready yet. Enabling the commented PRE-BRIDGE-EVENTS code in RNFirebaseNotifications seems to resolve the issue. Can this code be enabled to resolve this issue? if risky perhaps put it behind a flag that can be configured.
Project Files
iOS
ios/Podfile:
- [ ] I'm not using Pods
- [x] I'm using Pods and my Podfile looks like:
# N/A
RNFirebaseNotifications.m:
// N/A
Environment
- Platform that you're experiencing the issue on:
- [x] iOS
- [ ] Android
- [ ] iOS but have not tested behavior on Android
- [ ] Android but have not tested behavior on iOS
- [ ] Both
- If known, the version of the platform are you experiencing the issue on:
ADD_SOMETHING_HEREe.g. iOS 10 or Android API 28
- Operating System:
- [ ] MacOS, version:
N/A - [ ] Windows, version:
N/A - [ ] Other, please specify:
N/A
- [ ] MacOS, version:
- Build Tools:
ADD_SOMETHING_HEREe.g. Xcode 10, Android Studio 3.2
React Nativeversion:ADD_SOMETHING_HERE
React Native Firebaselibrary version:ADD_SOMETHING_HERE
Firebasemodule(s) you're using that has the issue:- [x] N/A
- [ ] Authentication
- [ ] Analytics
- [ ] Cloud Firestore
- [ ] Cloud Messaging (FCM)
- [ ] Crashlytics
- [ ] Dynamic Links
- [ ] Functions Callable
- [ ] Invites
- [ ] Instance ID
- [ x] Notifications
- [ ] Performance Monitoring
- [ ] Realtime Database
- [ ] Remote Config
- [ ] Storage
- Are you using
TypeScript?- [ ] No
- [ ] Yes, version:
N/A
- Are you using Expo, e.g.
ExpoKit?- [x] No
- [ ] Yes, I've not ejected
- [ ] Yes, but I have ejected to
ExpoKit - [ ] Yes, but I have ejected to vanilla React Native
- Expo version:
N/A
Think react-native-firebase is great? Please consider supporting the project with any of the below:
- 👉 Donate via Open Collective
- 👉 Follow
React Native FirebaseandInvertaseon Twitter - 👉 Star this repo on GitHub ⭐️
- 👉 Contribute; see our contributing guide
Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
same me, when app killed, if i click to open app from notification, app crashed. how to debug remote notification if app killed with real device?
Even with commented out // PRE-BRIDGE-EVENTS the app still opens and crashes on a notification click.
I have reproduced this issue on iOS but I am not experiencing it with Android.
Does anyone have any tips on tools to debug this? I'm not sure how to get the stack trace on iOS...
In my case it was expokit SDK32 related, fix is here -> https://github.com/expo/expo/pull/3431/files
@coulix that looks like my issue! Were you able to upgrade Expokit and fix it? What version of Expokit are you on?
Fixed it!
https://github.com/expo/expo/pull/3431#issuecomment-462086795
Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.
Hi @blankg , I have the exact same issue as you. I applied the same workaround you described with no success. I use react-native-firebase 4.2.0.
Did you made another changes to resolve this issue ? Thank you in advance.
@zarvedan , I used it with 5.1.1 so that could be the issue. You can checkout the version we use from our fork https://github.com/capriza/react-native-firebase
@blankg I did a fresh install with react-native-firebase: 5.2.1 and your workaround and I confirm that it works. Many thanks for your help, it was hard to find a solution to my issue.
@salakar In my case, it was an iOS issue, not Expo.