fix: emit messaging_notification_opened only for default notification action on iOS.#8945
fix: emit messaging_notification_opened only for default notification action on iOS.#8945mtjkln wants to merge 4 commits into
Conversation
…lt notification action Ensure messaging_notification_opened is emitted only when the UNNotificationDefaultActionIdentifier is triggered. This prevents onNotificationOpened from being invoked for custom notification actions.
|
@mtjkln is attempting to deploy a commit to the Invertase Team on Vercel. A member of the Team first needs to authorize it. |
|
Hello 👋, this PR has been opened for more than 14 days with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
Apologies this went stale without a look, it deserves a look |
@mikehardy thanks for reopening this, it will be really helpful if you can review this PR, as it will help all the devs who want to implement custom action and not worry about unexpected redirection, which happens when user interacts with the custom action, example reply from notification. |
Description
🔥 Fix: emit messaging_notification_opened only for default notification action on iOS.
Summary
Ensure
messaging_notification_openedis emitted only when the default notification action is triggered on iOS.Previously the event could be emitted for all
UNNotificationResponseactions, including custom notification actions.This change restricts the event emission to
UNNotificationDefaultActionIdentifier, ensuringonNotificationOpenedAppis invoked only when the user taps the notification body.Why
When notifications include custom actions (e.g. Reply, Mark as Read), selecting those actions previously triggered
messaging_notification_opened.This caused
onNotificationOpenedAppto fire and often resulted in unintended navigation or redirection in apps that rely on the default notification tap behavior for routing.By emitting the event only for
UNNotificationDefaultActionIdentifier, custom actions no longer triggeronNotificationOpenedApp, aligning the behavior with expected iOS notification interaction patterns.Related issues
N/A
Release Summary
Fix iOS behavior where
messaging_notification_openedcould be emitted for custom notification actions. The event is now emitted only for the default notification tap.Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/**/e2ejesttests added or updated inpackages/**/__tests__Test Plan
onNotificationOpenedAppis triggered.onNotificationOpenedAppis not triggered.Think
react-native-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter