Files
t3code/apps/mobile/src/lib/appLinking.ts
T
Dara AdedejiandDevin AI 0ec2b08a9a fix(mobile): bare t3code:// links no longer reset navigation to Home (#12002)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 23:27:01 -03:00

18 lines
762 B
TypeScript

/**
* The Expo dev client launches the app via
* <scheme>://expo-development-client/?url=<packager> — that URL addresses
* the launcher, not app navigation. Without this filter it falls through
* to the NotFound wildcard route on every dev launch.
* expo-sharing uses a private lifecycle URL only to wake the app. The
* persisted share inbox in App.tsx owns navigation once the payload is durable.
* A scheme-only URL, as sent by iOS dictation keyboards returning to the app,
* only wakes the app and must not reset navigation to Home.
*/
export function shouldHandleAppLink(url: string): boolean {
return (
!url.includes("expo-development-client") &&
!url.includes("://expo-sharing") &&
!/^t3code(-dev|-preview)?:\/*$/.test(url)
);
}