Skip to main content
Deep links are URLs that take users directly to specific content within a mobile app or website, rather than just launching the app’s home screen. They work like shortcuts, enabling smoother navigation and improving user experience. In this guide, you will learn the basics of adding deep links into your Expo-based mobile app. 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.
Deep links can also have params just like web links! Example:
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 the app.json file in the Expo project.
app.json
Custom schemes like myapp:// are not unique across Android or iOS. If two apps register the same scheme, the system won’t know which one to launch, or it might launch the wrong one. Use something app-specific and hard to accidentally duplicate.
In your app entrypoint (e.g., _layout.tsx or a provider), add logic to:
  • Handle initial deep link
  • Listen for deep link changes
A good practice is to create a DeepLinkHandler and wrap the entire app with it. Example (in an Expo project using File-based routing):
app/_layout.tsx
That’s it, your app is ready to handle deep links based on the 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! Here’s a demo of how deep links work in a mobile app:

Testing on iOS simulator

Example:

Testing on Android emulator

Example:
If you don’t use single quotes, the shell will interpret & as a command separator, and only the first parameter will be passed to the app.

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 the branch/deeplink branch.
Here are some deep links you can try:
  1. Swap MON to USDC
  1. Swap 100 MON to USDC
  1. Swap USDC to WMON