What are deep links?
Deep link is constructed by three parts:- Scheme: The URL scheme that identifies the app that should open the URL (example: myapp://). It can also be https or http for non-standard deep links.
- Host: The domain name of the app that should open the URL (example: web-app.com).
- Path: The path to the screen that should be opened (example: /product). If the path isn’t specified, the user is taken to the home screen of the app.
Building a deep link
If you’d like to try a deep link demo you can do by cloning this repo and switching to the
branch/deeplink branch:Defining the scheme
The first step is to define a scheme; you can do so by editing theapp.json file in the Expo project.
app.json
Listening for deep link events
In your app entrypoint (e.g.,_layout.tsx or a provider), add logic to:
- Handle initial deep link
- Listen for deep link changes
DeepLinkHandler and wrap the entire app with it.
Example (in an Expo project using File-based routing):
app/_layout.tsx
hostname and queryParams you can redirect the user to the respective screens.
Additionally if you make the queryParams accessible globally (via context or some other way) you can prefill input values too!
Example: Prefilling token swap amounts!
Testing the deep link
Here’s a demo of how deep links work in a mobile app:Testing on iOS simulator
Testing on Android emulator
Testing on a physical device
You can create a simple HTML page with links. Example:Try out the demo
If you’d like to try a deep link demo you can do by setting up this repo and switch to thebranch/deeplink branch.
- Swap MON to USDC
- Swap 100 MON to USDC
- Swap USDC to WMON

