Opening Links in the App
With routing, a link to the app's domain opens the installed app instead of the browser, and the router goes to the link's path, through watchAppLinks. Fill in native.appLinks.domain, then:
- iOS: set
native.ios.teamId.pnpm mobile:syncadds the domain to the app's Associated Domains and writespublic/.well-known/apple-app-site-association. Links innative.appLinks.excludestay in the browser: by default, the ones carrying a sign-in token. - Android: add the SHA-256 fingerprints of the keys that sign the app to
native.android.sha256: Google's app signing key and your upload key, both under Test and release → App integrity → App signing in Play Console.pnpm mobile:syncwritespublic/.well-known/assetlinks.jsonand the intent filter. Android can't exclude a link: it opens the paths innative.appLinks.paths,["/*"]by default, so list the ones that should open the app, such as["/", "/jobs*"]. - Deploy the site, so the domain serves both files.
vercel.jsonalready serves them as JSON.
json
"native": {
"appLinks": {
"domain": "app.example.com",
"paths": ["/", "/jobs*"],
"exclude": ["#*access_token*", "/onboarding*"]
}
}Patterns end in * to match a prefix: /jobs* is every path that starts with /jobs. exclude takes paths and, starting with #, fragments.
Test on a device by tapping a link in Notes or Messages; typing it in Safari doesn't count. Both files are cached, so a change can take a few hours to arrive, and Android checks the domain when the app is installed or updated: adb shell pm get-app-links <app id> should say verified.
