Closed Avishayy closed 1 year ago
Looks like it's somewhat intentional? https://github.com/invertase/notifee/issues/616
I'll note that I'm referring only for receiving a notification in the background, and there's no notifee.onNotificationOpenedApp()
equivalent
I think I figured it out, the overwrite is (probably) intentional.
The confusion originated from several factors:
notifee.onBackgroundEvent()
doesn't get triggered, but notifee.onForegroundEvent()
doesI 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 https://github.com/invertase/notifee/issues/616. I will make this a priority to update docs.
Preface
Lately I've updated my project
$RNFirebaseAsStaticFramework = true
withuse_frameworks! :linkage => :static
Deeplinking from notifications stopped working only on iOS (Android working as expected)
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 notificationI'm not familiar that much with Objective C, if I'm missing something completely obvious, please let me know.
What 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. 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.