RORK LABJP
MAX — Rork Max generates native Swift for every Apple platform, from iPhone to Vision ProNATIVE — It reaches native capabilities like AR/LiDAR, Metal 3D, Dynamic Island, Live Activities, and HealthKitPUBLISH — Publish to the App Store in two clicks; Rork Max is $200/monthEXPO — Standard Rork builds iOS and Android together via React Native (Expo) and is free to startPROMPT — Describe your app idea in plain English and Rork generates deployable, store-ready codePRICE — Standard Rork's paid plans start at $25/month: build with it first, then consider Max for native featuresMAX — Rork Max generates native Swift for every Apple platform, from iPhone to Vision ProNATIVE — It reaches native capabilities like AR/LiDAR, Metal 3D, Dynamic Island, Live Activities, and HealthKitPUBLISH — Publish to the App Store in two clicks; Rork Max is $200/monthEXPO — Standard Rork builds iOS and Android together via React Native (Expo) and is free to startPROMPT — Describe your app idea in plain English and Rork generates deployable, store-ready codePRICE — Standard Rork's paid plans start at $25/month: build with it first, then consider Max for native features
Articles/Dev Tools
Dev Tools/2026-06-21Advanced

Your Notification Opens the App but Lands on Home — Routing Rork Apps by Launch State

How to make a notification tap reliably reach its target screen. We cover the three launch states — killed, background, foreground — and a pending-route design that never drops a tap that arrives before navigation is ready.

Rork431Expo89Notifications2Deep Linking5Routing

Premium Article

On one app I run, I once sent a "your order has shipped" push notification from the server. Tapping it launched the app — but it just sat on the home screen and never opened the order detail. It worked perfectly on my test device, so the cause took a while to pin down.

The short version: when the app launched from a fully killed state via the tap, my navigation command fired before the navigator was mounted. The command was quietly ignored, with no error.

Almost every notification-routing headache comes down to this one gap: the moment of the tap versus the moment a screen can actually be drawn. Let me walk through a design that absorbs that gap, organized by launch state.

The three launch states you have to account for

When the user taps a notification, the way you receive that tap depends entirely on what state the app was in. Conflate these and you end up with code that only works in one of them.

Launch stateApp conditionWhere the tap comes from
killed (cold start)Process was terminatedgetLastNotificationResponseAsync()
backgroundSuspended in the backgroundResponse listener
foregroundVisible on screenResponse listener

A cold start is the tricky one: the tap that launched the app may never reach your listener. By the time the app boots and registers the listener, that event has already passed. That is exactly why you need to fetch the "last response" once at startup.

In the background and foreground states the app is already alive, so the listener fires reliably.

Put the routing info in the notification's data

What decides the destination is not the notification body — it's the data payload. Send a structured destination on every notification from the server.

// Notification payload the server sends (example)
{
  "to": "ExponentPushToken[xxxxxxxx]",
  "title": "Shipping update",
  "body": "Your order is on its way",
  "data": {
    "type": "order",
    "id": "A-10293"
  }
}

Structuring it as type and id makes it far easier to validate when you reassemble the route later. You could also drop a fully formed URL string into data, but using a server-supplied string directly as a destination is something I'd rather avoid — I'll explain why toward the end.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A pending-route design that absorbs the gap between the moment of the tap and the moment a screen can render
An implementation that reliably catches notification taps across all three launch states: killed, background, and foreground
How to wire an allowlist and a safe fallback so you never push the user to an unvalidated route
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Dev Tools2026-06-16
Notifications You Can Finish Without Opening the App — Interactive Notification Actions for Rork Apps
Those buttons and text fields that appear when you long-press a notification. Here is how to implement interactive notification actions in a Rork-built Expo app for an experience that completes without launching, including the background-execution pitfalls.
Dev Tools2026-06-20
Why Your Rork List Starts Duplicating and Dropping Rows as It Grows — Cursor Pagination and Resilient Refetch State
The naive offset pagination Rork scaffolds for you quietly breaks the moment your list changes underneath the user. Here is how to move to a cursor contract, fold every fetch state into one usePaginatedList hook, and recover failed page loads with exponential backoff — implementation first.
Dev Tools2026-06-20
Bugs Rork Can Fix vs. Bugs You Should Fix Yourself: A Triage Workflow for Exported Code
A practical triage workflow for telling apart the bugs Rork resolves on its own from the ones you should hand-fix in exported React Native/Expo code, with working examples.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →