-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
🔥Library blocks all local notification opening events on iOS #3414
Comments
Thanks for the detailed issue. We're tracking this on #3367 - we think we know what the issue is, just need to find some time to implement the fix! |
Thanks, sounds good! Sorry about the duplicate, feel free to close this one. |
Please try |
Tried to use this PR. Still, I am not getting the AppDelegate willPresentNotification or didReceiveNotificationResponse callbacks. I am using version 6.4.1-alpha.0 @Salakar |
Posting your AppDelegates is the only way we can help here. We need to see what's not being forwarded. |
@Ehesp Please check #3427 (comment) |
Issue
React Native Firebase reacts to opening the app through a Cloud Messaging notification by triggering the
onNotificationOpenedApp
event. On iOS when creating a local notification using a third party library and opening the app by tapping on it, react-native-firebase blocks the event from reaching the third party library and no event is triggered, either by this library or the one that created the alert.There's a warning in the XCode console that's related:
The Objective-C code that blocks the event is this:
react-native-firebase/packages/messaging/ios/RNFBMessaging/RNFBMessaging+UNUserNotificationCenter.m
Lines 70 to 78 in d66a611
I don't know much about how iOS handles events but apparently this method overrides its third-party library counterparts, and because this handler only does anything with notifications coming from Cloud Messaging, it effectively blocks handling all other notification types. Optimally this would somehow tell UNUserNotificationCenter to move on to the other handlers but I don't know how that would be done or if it's even possible.
Another solution would be to let
onNotificationOpenedApp
handle all notifications and e.g. add a flag that tells whether it's a local notification or a Cloud Messaging notification.Project Files
Javascript
Click To Expand
package.json
:# N/A
firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:N/A
react-native-firebase
version you're using that has this issue:Firebase
module(s) you're using that has the issue:TypeScript
?React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: