You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[iOS] Notifee somehow overwrites RNFBMessaging's userNotificationCenter:didRecieveNotificationResponse:withCompletionHandler, causing onNotificationOpenedApp() to never get called
#644
Closed
Avishayy opened this issue
Jan 12, 2023
· 3 comments
I put a breakpoint at the beginning of the function, it was never called. I searched a bit and found out that notifee also has the same function under NotifeeCoUNUserNotificationCenter.m.
I put a breakpoint there, and voilà, it stops on notifee's function. I looked a bit at the code that does the swizzling (I think?), and it looks like notifee's overwritten react-native-firebase's call. I'm still trying to understand the whole flow but I thought I'd open an issue here to see if there's quicker feedback.
Here's the stack trace for this call
For what it's worth, I uninstalled notifee and commented out its references in the code, and onNotificationOpenedApp() worked as usual.
Any help is appreciated, thank you.
The text was updated successfully, but these errors were encountered:
I think I figured it out, the overwrite is (probably) intentional.
The confusion originated from several factors:
The docs aren't clear enough on the fact rather than working alongside react-native-firebase, you overwrite its functionality
The overwritten functionality does work on Android (which makes me question whether it's intentional)
The overwritten functionality did work before making the upgrades
4.notifee.onBackgroundEvent() doesn't get triggered, but notifee.onForegroundEvent() does
I think the lack of documentation on this regard and the inconsistency between Android and iOS is harmful, for now I'll just change the functions I use, as the fix in my case should be trivial.
I'm leaving this open to hear about notifee's opinion.
Thank you for your feedback! The decision to do this was needed for the most common use-case with quick actions and to simplify the event handling process. The plan is to do the same with Android.
Will close this in favour of #616. I will make this a priority to update docs.
Preface
$RNFirebaseAsStaticFramework = true
withuse_frameworks! :linkage => :static
setBackgroundMessageHandler(cb)
,cb
is called as expectedonMessage(cb)
,cb
is called as expectedonNotificationOpenedApp(cb)
,cb
is NEVER called, so we never resolve the link from an opened notificationWhat I did
I've started debugging the native code and found this piece of code which should
in
RNFBMessaging+UNUserNotificationCenter.m
I put a breakpoint at the beginning of the function, it was never called. I searched a bit and found out that notifee also has the same function under
NotifeeCoUNUserNotificationCenter.m
.I put a breakpoint there, and voilà, it stops on notifee's function. I looked a bit at the code that does the swizzling (I think?), and it looks like notifee's overwritten react-native-firebase's call. I'm still trying to understand the whole flow but I thought I'd open an issue here to see if there's quicker feedback.
![image](https://user-images.githubusercontent.com/5567310/212046660-822401a5-1fb1-4900-a524-ca5a8d4bbacf.png)
Here's the stack trace for this call
For what it's worth, I uninstalled notifee and commented out its references in the code, and
onNotificationOpenedApp()
worked as usual.Any help is appreciated, thank you.
The text was updated successfully, but these errors were encountered: