Repository navigation
Conversation
… navigation - Add FirebaseMessaging.onMessageOpenedApp listener to navigate when user taps a notification while app is in the background - Add FirebaseMessaging.getInitialMessage() call to handle notification taps that launch the app from terminated state - Expose NotificationUtil.handleNavigateTo() as a public static method to support programmatic deep-link navigation from FCM handlers Fixes: tapping Omi response notifications opens app to last screen instead of navigating to the relevant conversation Closes #5126
There was a problem hiding this comment.
Code Review
This pull request correctly addresses an issue with notification tap navigation from background and terminated states by adding the necessary FCM handlers. The changes are logical and follow the PR's objective. I've added one suggestion to refactor the new handlers to reduce code duplication and improve type safety, aligning with the preference for helper functions to centralize complex logic, which will enhance the code's maintainability and robustness.
…plicate logic Addresses Gemini review: consolidates duplicated background/terminated notification tap handling into a single local helper and uses `is String` type check instead of `.toString()` for safer payload handling. Co-Authored-By: Claude Opus 4.6 <[email protected]>
beastoin
left a comment
There was a problem hiding this comment.
Review by @ryo
Clean fix. Small change (+20/-0), correctly handles both FCM notification tap paths:
- Background →
onMessageOpenedApp.listen()— fires when app is backgrounded and user taps notification - Terminated →
getInitialMessage()— fires when app was killed and reopened via notification
The public handleNavigateTo() method properly delegates to the existing _handleAppLinkOrDeepLink() navigation system. No side effects on existing notification flows.
Recommendation: Safe to merge.
Withdrawing review — re-reviewing after internal discussion.
|
Hey @mdmohsin7 👋 Friendly reminder — this PR has been quiet for a bit. If you don't need further assistance from the CTO, feel free to go ahead and merge it. Let's close the loop and not let it go stale. Thanks! |
|
Don't let your PR go stale. Unfortunately, I won't review further PRs from the internal team proactively, so please reopen and mention others who have review permissions. It's important to keep PRs from going stale. |
|
Hey @mdmohsin7 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! 💜 |
…5126) (#11144) * fix(app): navigate from FCM background/terminated notification taps (#5126) Register onMessageOpenedApp and getInitialMessage so push taps honor navigate_to instead of leaving the user on the last screen. Resurrects closed #5127 with a shared String-safe navigate_to parser. Co-authored-by: Cursor <[email protected]> * fix(app): wait for navigator before FCM cold-start navigate (#5126) getInitialMessage can resolve before runApp attaches globalNavigatorKey, so pushReplacement previously no-op'd on terminated taps. Poll until the navigator is ready (same race class as app_links #4763). Co-authored-by: Cursor <[email protected]> * fix(app): const FCM navigate_to test maps for analyzer ratchet (#5126) Non-const map literals tripped prefer_const_literals (baseline 0). Drop the redundant foundation import that also added an unnecessary_import. Co-authored-by: Cursor <[email protected]> * chore(ci): retrigger checks after hermetic scope timeout (#5126) Detect Hermetic Backend Scope hit the 2m job timeout (cancelled); Merge Gate fail-closed on SCOPE_RESULT=cancelled. App-only PR — no backend scope change. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
Problem
Fixes #5126
When a user taps an Omi response push notification:
Root Cause
The Flutter app was missing two FCM handlers in
notification_service_fcm.dart:FirebaseMessaging.onMessageOpenedApp— fires when user taps a notification while app is in the backgroundFirebaseMessaging.instance.getInitialMessage()— fires when app is launched from a killed state via notification tapThe backend already sends
navigate_to(e.g./chat/omi) in the FCM data payload — the app just never read it on tap.Changes
notification_service_fcm.dart: AddedonMessageOpenedApplistener andgetInitialMessage()call inlistenForMessages()notifications.dart: ExposedNotificationUtil.handleNavigateTo(String route)as a public static method (wraps existing_handleAppLinkOrDeepLink)Testing