-
Notifications
You must be signed in to change notification settings - Fork 261
Description
Notifee is, per its docs, "a library for React Native, bringing local notification support to both Android & iOS applications."
Yet it purposefully and knowingly breaks React Native Firebase's remote notification tap handlers in v7.x (link):
onNotificationOpenedApp and getInitialNotification from RNFB Messaging will no longer trigger as Notifee will handle the event. Should not require any code changes to these RNFB event handlers, as events on Android will continue to work as normal
onNotificationOpenedApp and getInitialNotification are effectively required to do anything interesting with remote notifications. It's difficult for me to imagine any serious app using remote notifications without using them.
I'm not familiar with the intricacies of this decision, but to me the stated goal ("This allows quick actions from remote notifications to be supported without the need of a NSE") does not nearly justify the change. Handling quick actions is rare, whereas handling simple taps is extremely common (basically table stakes). This change purposefully and knowingly breaks an adjacent library irreparably in exchange for a slightly simpler implementation of itself.
There was also a simple solution requested back in April, here: #755
I would like to see a functionality where I can turn that off in notifee, something like:
notifee.setRemoteHandling(false);
I agree with it - except that I feel the more proper solution is to flip it around: notifee should NOT break other libraries by default. It should be opt-in, i.e. something like this:
To handle remote notifications with Notifee, use
notifee.setRemoteHandling(true);NOTE: If you use React Native Firebase's Messaging library, by setting remote handling to true,
onNotificationOpenedAppandgetInitialNotificationwill no longer trigger.
Again, Notifee is, per its own docs, "a library for React Native, bringing local notification support to both Android & iOS applications." Yet you are taking over and breaking adjacent package functionality BY DEFAULT and without a way to opt-out.
If there is further discussion or justification of this, please share. If Notifee is intended to be the end-all be-all for all types of Notifications, please state this goal, and clarify that in the React Native Firebase documentation (since intvertase manages both). As-is it feels extremely developer-hostile, unexpected, and under-documented across both packages.
In the meantime, for developers, switching back to version 6.x seems to be the only to keep existing remote notification functionality unbroken.