Configuring Custom URL Schemes
Define a custom URL scheme in app.json for Expo, test opening the app from a terminal with xcrun openurl or adb, and read the initial URL on app launch.
What Is Deep Linking?
Deep linking allows external URLs — in emails, web browsers, QR codes, or other apps — to open your React Native app and navigate directly to a specific screen rather than the home screen. This dramatically improves user experience for notifications, marketing campaigns, and cross-app flows.
There are two types of deep links: custom URL schemes (like myapp://profile/123) and universal links (like https://example.com/profile/123). This lesson covers custom URL schemes, which are simpler to set up and work on both iOS and Android.
Configuring the Scheme in app.json
In an Expo managed app, you register your custom URL scheme in app.json under the scheme key. Choose a scheme that is unique to your app — using a generic term risks conflicts with other apps. Convention is to use your app name in lowercase, like myappname.
After adding the scheme, you must rebuild the native app (run npx expo run:ios or run:android) because scheme registration requires native configuration. The scheme is read from app.json by Expo's prebuild pipeline and injected into the native project files automatically.
// app.json
{
'expo': {
'name': 'MyApp',
'slug': 'my-app',
'scheme': 'myapp', // registers myapp:// scheme
'ios': {
'bundleIdentifier': 'com.example.myapp'
},
'android': {
'package': 'com.example.myapp'
}
}
}All lessons in this course
- Configuring Custom URL Schemes
- Linking API and URL Parsing
- React Navigation Deep Link Configuration
- Universal Links (HTTPS Deep Links) on iOS and Android