Skip to content
Urlzee

Deep Links Explained: Universal Links and App Links

By Urlzee Team · Published · 7 min read

A deep link opens a particular screen inside a mobile app instead of the app's front page or a website. On iOS the modern mechanism is Universal Links, and on Android it is App Links. Both use ordinary https:// URLs that the operating system hands to your app after verifying that the app and the domain belong together.

They take someone straight to the thing they tapped on. Without deep links, a person who taps a product link in a message lands on the mobile website even though your app is installed and they are already logged in to it. With deep links, the same tap opens that product in the app.

The term covers three different technologies.

Custom URL schemeiOS Universal LinksAndroid App Links
Examplemyapp://products/42https://example.com/products/42https://example.com/products/42
Proves domain ownershipNoYesYes
App not installedFailsOpens the web pageOpens the web page
Works as a normal web linkNoYesYes
Verification fileNoneapple-app-site-associationassetlinks.json

What is wrong with custom URL schemes?

They are simple, and that is the only advantage. An app registers a scheme such as myapp://, and any link starting with it is passed to the app.

The weaknesses are structural:

  • No fallback. If the app is not installed, the link has nowhere to go. Websites have worked around this with JavaScript timers that redirect to an app store, which is fragile.
  • No ownership. Nothing stops another app from registering the same scheme. Which one opens is up to the operating system.
  • Not a real URL. Many apps and email clients will not make myapp:// links tappable, and they cannot be previewed, indexed or opened on a desktop.

Custom schemes still have uses, such as returning to an app at the end of a sign-in flow. For links you share with the public, use the verified https mechanisms.

Universal Links tie an https domain to an app through a file on the website and an entitlement in the app. Each side has to name the other, so neither can claim the association alone.

  1. Add the Associated Domains capability to the app with an entry such as applinks:example.com.
  2. Host an apple-app-site-association file at https://example.com/.well-known/apple-app-site-association. It is JSON, has no file extension, and must be served over HTTPS directly, without redirects.
  3. Handle the incoming URL in the app and route it to the right screen.

A minimal association file looks like this:

{
  "applinks": {
    "details": [
      {
        "appIDs": ["ABCDE12345.com.example.app"],
        "components": [
          { "/": "/products/*" }
        ]
      }
    ]
  }
}

appIDs is your team ID followed by the bundle identifier. components lists the paths the app should open; anything else stays in the browser.

When the app is installed, iOS fetches the file and remembers the result. After that, tapping a matching link opens the app. If the app is not installed, the link opens in Safari as an ordinary web page. Apple's setup reference is Supporting associated domains.

One behaviour surprises people: Universal Links respond to a person tapping a link. Typing or pasting the URL into Safari's address bar loads the website, and so do links that go to the same domain as the page you are already on.

Android App Links follow the same two-sided design. The app declares which URLs it handles, and the website confirms which app is allowed to.

  1. Declare an intent filter in the app's manifest with android:autoVerify="true":
<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="https" android:host="example.com" android:pathPrefix="/products" />
</intent-filter>
  1. Host a Digital Asset Links file at https://example.com/.well-known/assetlinks.json:
[
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "com.example.app",
      "sha256_cert_fingerprints": [
        "AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99"
      ]
    }
  }
]
  1. Handle the intent in the activity and navigate to the content.

The fingerprint is the SHA-256 hash of the certificate that signs your app. If an app store re-signs your app on your behalf, use the fingerprint of that signing key, which the store's developer console shows.

Android verifies the file when the app is installed. If verification succeeds, matching links open the app without asking. If it fails, the link opens in the browser. Google's guide is Handling Android App Links.

On real devices, with real taps. Simulators and address bars do not behave like the situations your users are in.

  • Check the files first. Both association files must return 200 with JSON at the exact .well-known path, over HTTPS, without a redirect. curl -s -o /dev/null -D - https://example.com/.well-known/assetlinks.json shows the status and content type. See how to test redirects with curl.
  • iOS. Paste the link into the Notes app and tap it. A long press shows an "Open in" option naming your app when the association is working.
  • Android. Trigger a link from the command line with adb shell am start -a android.intent.action.VIEW -d "https://example.com/products/42". On Android 12 and later, adb shell pm get-app-links com.example.app shows the verification state for each domain.
  • Test where your links will be shared. Messages, email, a QR code scanned with the camera, and the in-app browsers of social apps can all behave differently.

Reinstall the app after changing an association file, because both platforms cache the verification result.

They add uncertainty, and you should know why. A short link lives on the shortener's domain, not yours. Tapping https://urlzee.com/product-42 cannot open your app directly, because your app is associated with example.com, not with the shortener. The tap opens a browser, the shortener answers with a redirect to https://example.com/products/42, and only then does a URL on your domain appear.

Whether the operating system gives that redirected URL to your app depends on the platform, its version and the app the tap happened in. It often works from a messaging app or the system browser, and often does not inside the in-app browsers of social apps, which tend to keep the whole journey in their own web view.

That leads to two practical rules:

  1. Make the web page good. Every deep-linkable URL should be a working page on your site, because a meaningful share of visitors will land there whatever you do.
  2. Test the exact link you will publish, in the exact place you will publish it.

Some link services are built for app routing: they host the association files on their own link domain and send each visitor to the app, the store or the web by device. Urlzee is not one of those. It is a general URL shortener that answers every visitor with the same 302 redirect, and it does not offer custom domains, per-device routing or deferred deep linking. What it adds to a deep-linkable URL is a short address, a QR code and click analytics. When opening the app matters most, link straight to your own domain.

If you do shorten such a URL, you can create the link with the URL shortener and confirm the redirect arrives intact with the URL expander.

It is a deep link that survives an installation. The visitor taps a link, does not have the app, installs it from the store, and on first launch is taken to the content they originally wanted.

Neither Universal Links nor App Links do this by themselves, because the store visit breaks the chain. Deferred deep linking needs something to remember the intended destination across the install, which usually means a third-party SDK or attribution data provided by the app stores.

Do not confuse any of this with "dynamic links" in the URL-shortening sense, which simply means a short link whose destination can be edited later. That idea is covered in dynamic links.

A sensible setup

Use https links on your own domain as the single address for each piece of content. Verify the domain for both platforms so that installed apps open directly. Make sure every one of those URLs is also a proper web page, and treat short links as a convenience layer for print, QR codes and tracking, not as part of the app-opening mechanism. Path matching in both association files works on the host and path of the URL, so anatomy of a URL is a useful refresher if those terms are hazy.

Frequently asked questions

What is a deep link?
A deep link is a link that opens a specific screen inside a mobile app, such as a product or an order, instead of the app's home screen or a web page.
What is the difference between Universal Links and App Links?
They are the same idea on two platforms. Universal Links are Apple's system for iOS, verified with an apple-app-site-association file. App Links are Android's, verified with an assetlinks.json file. Both use ordinary https URLs that fall back to the website when the app is not installed.
What happens if the app is not installed?
With Universal Links and App Links, the URL simply opens in the browser, because it is a normal web address. With a custom URL scheme such as myapp://, nothing useful happens: the link fails or shows an error.
Do short links work as deep links?
A short link redirects to your URL in the browser, and the operating system may or may not hand that redirected URL to your app. It often works from a tap in a messaging app or the system browser, but in-app browsers frequently keep the visitor on the web. Test on real devices.
What is a deferred deep link?
A deferred deep link remembers the intended destination while a new user installs the app, then opens that content on first launch. It is not a built-in operating system feature and normally requires a third-party SDK or your own install-attribution logic.