fix(messaging, ios): prioritize delegate call order in willPresentNotification - #8786
Conversation
|
@wrtn-wontak is attempting to deploy a commit to the Invertase Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi there @WontakKim looks good to me just fix the linter issues please and I will approve it and ensure the CLA is signed. |
|
Hi @MichaelVerdon, I've signed the CLA docs and ran |
38a52cd to
7af280b
Compare
|
Hi @MichaelVerdon , kindly reminds you to review this PR. Thanks. |
|
Hello 👋, this PR has been opened for more than 2 months 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 15 days until this gets closed automatically |
|
Hi @MichaelVerdon , It's been a while since I left my last comment, but I haven't received any response yet. Could you please check on this? |
Hi there apologies, I got caught up in alot of other work. I am looking now, thank you for your patience |
|
This looks good to me hapy to approve after CI runs on this one. Have you signed the CLA? |
|
Hi, yes I have signed CLA. |
|
Hi @WontakKim - the CLA bot doesn't seem to be registering the agreement - the typical cause of this is misaligned email address in github vs the commit. I see You'll need to choose and either make sure the email address you configured in git for your commits is added to your github account or that you rewrite the commits and repush them after you reconfigure git to be the same email you use for your github account |
mikehardy
left a comment
There was a problem hiding this comment.
looks good to me (thank you!) pending resolution of CLA signing issue
|
I am closing and reopening just to re-trigger CI checks, despite being an admin in the repo github CI is stuck for this PR |
|
I resigned CLA. @mikehardy thanks for guiding me. |
4cee1d5 to
f2eae6c
Compare
|
android check failure was a flake, it passed on rerun but there was still a problem with ios for some reason CI should re-run then ideally this is good to go, I'll check it in the morning |
After bumping `@react-native-firebase/*` from 20.1.0 to 23.8.8 in #7319 (Apr 2026), iOS users see both a system banner AND a notifee-displayed local notification when a push arrives while the app is foregrounded. Pre-bump behavior was the notifee notification only. The cause is upstream: invertase/react-native-firebase#8786 (merged Feb 2026, shipped in v23.8.5) reordered RNFB's iOS `willPresent` delegate so the original AppDelegate handler is called first. Previously, RNFB consumed the one-shot `completionHandler` with its own default options (empty, since we don't have a `firebase.json`) before forwarding to AppDelegate, making AppDelegate's `completionHandler([.sound, .badge, .list, .banner])` a no-op. With the new order, AppDelegate wins and iOS now honors the full `[.sound, .badge, .list, .banner]` set the handler has been quietly asking for since #6607 (Aug 2025). This change updates AppDelegate's `willPresent` to call `completionHandler([])`, which suppresses all iOS-side presentation for the FCM remote when foregrounded. Rainbow's user-visible foreground notification UI is rendered by notifee from the separate `onMessage` JS handler (`src/notifications/foregroundHandler.ts` → `notifee.displayNotification`). Letting iOS also present the FCM payload would duplicate Notification Center entries and add badge increments that pre-bump prod never had. Returning `[]` matches the pre-RNFB-23.8.5 default of `UNNotificationPresentationOptionNone`. Background and killed-app notifications are unaffected since this delegate only runs in the foreground case.
Description
This PR fixes an issue where
completionHandlerinuserNotificationCenter:willPresentNotification:withCompletionHandler:is called before the original delegate, preventing custom foreground notification presentation logic from working.Related issues
Release Summary
Fixed iOS messaging to respect custom notification presentation logic by calling the original delegate before consuming the completionHandler.
Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/\*\*/e2ejesttests added or updated inpackages/\*\*/__tests__Test Plan
Tested Scenario:
willPresentNotificationhandler in AppDelegate to control notification presentationBefore Fix:
After Fix:
Code Example Tested: