Deep links and universal links in Capacitor
Make your Capacitor app open from URLs. How to set up deep links, iOS universal links, and Android app links — association files, intent filters, and routing — and tune the routing logic over the air.
Deep links let a URL open your app on the right screen — from an email, a notification, or the web. On iOS these are universal links; on Android, app links. Getting them working means a bit of native association plus some routing code. This guide covers the full setup in Capacitor, and how OtaKit lets you tune the routing over the air.
The association (proving you own the domain) is native and one-time. The routing — what each URL does inside your app — is web-layer code you can change over the air whenever your URL structure evolves.
1. Custom scheme vs universal/app links
- Custom scheme (
myapp://) is the quick option, but any app can claim a scheme and it doesn't work from the web cleanly. - Universal / app links use your real
https://domain and are the right choice for production — they require domain association files.
2. iOS universal links
Host an apple-app-site-association file at your domain root, and add the Associated Domains capability with applinks:yourdomain.com in Xcode. iOS verifies the file when the app installs.
3. Android app links
Host an assetlinks.json at /.well-known/, and add an intent filter with android:autoVerify="true" for your domain in the manifest.
4. Handle the link in your app
import { App } from '@capacitor/app';
App.addListener('appUrlOpen', (event) => {
// event.url is the full deep link
const path = new URL(event.url).pathname;
router.navigate(path);
});This handler is the part you'll iterate on — new routes, changed paths, redirects. All of it ships over the air:
otakit upload --release production
Test the association files early. A missing or misconfigured apple-app-site-association / assetlinks.json is the most common reason “deep links don't work,” and it fails silently — the link just opens the browser instead of the app.
Where to go next
Notification taps often route through the same code — see push notifications. For the setup basics, see Setup.