Universal Links

On this page 7

Universal Links are ordinary HTTPS web addresses that Apple platforms open directly inside a matching installed app instead of in Safari, after the operating system has verified that the app and the website belong to the same owner. In app development for mobile platforms, they are Apple’s standard mechanism for secure deep linking on iOS, iPadOS, macOS and related systems, introduced with iOS 9 in 2015.

The key property is a graceful fallback: one URL works everywhere. If the app is installed, the link opens the relevant screen in the app; if it is not, the same link simply loads the web page. This replaces fragile custom URL schemes and makes Universal Links the iOS counterpart of Android App Links.

Universal Links rely on two-way association between an app and a domain, which prevents unrelated apps from hijacking a website’s links. The app declares the domains it claims, and each domain publishes a file confirming which apps may handle its URLs.

On the app side, developers add the Associated Domains entitlement with entries such as applinks:example.com. On the web side, the domain serves an apple-app-site-association file, often abbreviated AASA, at /.well-known/apple-app-site-association over HTTPS, without redirects and without a file extension.

Since iOS 14, devices usually fetch the AASA file through an Apple content delivery network rather than directly from the developer’s server. The file is cached, so changes can take hours or longer to reach users. During development, an alternate mode in the entitlement lets devices bypass the cache.

The table below lists the components that must line up for verification to succeed.

ComponentWhere it livesPurpose
Associated Domains entitlementApp project and provisioning profileDeclares which domains the app claims
AASA fileWeb server, well-known pathLists app identifiers and allowed paths
App identifierInside the AASA fileTeam ID plus bundle ID of the app
Path rulesThe components or paths keysInclude or exclude specific URL patterns
Link handler codeApp delegate, scene delegate or SwiftUIRoutes the URL to the correct screen
Components of a working Universal Links setup

When the system decides a tapped link belongs to an app, it launches or foregrounds the app and delivers the URL as an NSUserActivity of the browsing-web type. The app must then parse the URL and navigate to the matching content.

In UIKit, the URL arrives through the continue user activity callbacks of the app delegate or scene delegate. In SwiftUI, the onOpenURL modifier or onContinueUserActivity receives it. A robust implementation uses a central router that maps URL paths to screens, validates parameters and shows a sensible default when content is missing.

Path matching is defined in the AASA file. Modern files use the components syntax, which can match on path, query and fragment and can explicitly exclude patterns, such as account pages that should always stay on the web.

Universal Links are one of several ways to open content inside a mobile app, and they differ mainly in security, fallback behavior and platform scope. The comparison below places them alongside the most common alternatives in the deep linking landscape.

MethodOwnership verifiedFallback without appPlatform
Universal LinksYes, through the AASA fileOpens the websiteApple platforms
Android App LinksYes, through an asset links fileOpens the websiteAndroid
Custom URL schemeNo, any app can register itError or nothing happensiOS and Android
Deferred deep linkDepends on the providerStore, then content after installCross-platform via services
App Clip linkYes, through associated domainsLightweight App Clip experienceiOS
Deep linking approaches on mobile platforms

Custom schemes remain useful for app-to-app communication where both sides are controlled, but they should not be the public entry point because another app can claim the same scheme. Deferred deep linking, which preserves context through an install, requires an additional service or attribution layer because Universal Links alone cannot survive the App Store step.

Universal Links trigger only in specific contexts, and the rules surprise many teams. The system opens the app when a user taps a link in apps such as Mail, Messages, Notes or many third-party apps that pass links to the system. It does not open the app when a user types or pastes the URL into the Safari address bar.

ContextOpens appReason
Tap in Messages or MailYesSystem link handling applies
Tap on a different domain in SafariUsuallyCross-domain navigation is eligible
Tap on the same domain in SafariNoSame-domain navigation stays on the web
URL typed in SafariNoTreated as explicit web intent
Some in-app browsersOften notEmbedded web views may handle links internally
Server-side redirect chainOften notRedirects can break link interception
Typical Universal Links behavior by context

Users can also opt out per domain. Long-pressing a link and choosing to open it in Safari, or tapping the domain breadcrumb in the app’s status bar, stores a preference that keeps future links on the web until reversed.

Common implementation mistakes

Most Universal Links failures come from small configuration mismatches rather than code errors, and they fail silently because the system simply opens Safari instead.

  • Serving the AASA file through a redirect, which the verifier rejects.
  • Wrong app identifier, such as a missing or mistyped Team ID prefix.
  • Forgetting subdomains, since www.example.com and example.com are separate entries.
  • Expecting instant updates, when the CDN cache delays new path rules.
  • Using redirecting tracking links in email campaigns, which often prevents the app from opening.
  • No in-app fallback, so unknown paths show a blank screen instead of a useful page.

Testing should cover cold launch and warm launch, fresh installs, multiple domains and the opt-out state. Apple’s diagnostic tools and the device console help confirm whether the association was validated.

A plain-language summary

Universal Links are normal web links that know how to open an app. If you tap a link to a store, a news article or a booking and you have that company’s app, the phone takes you straight to the right page inside the app.

If you do not have the app, nothing breaks: the same link opens the website. The phone only does this after checking that the app and the website really belong together, so a fake app cannot steal the links.

An example from practice

A regional airline sends boarding pass reminders by email with links such as a booking page on its main domain. Before adopting Universal Links, the links opened the mobile website, where passengers had to log in again before seeing their pass.

The mobile team adds the Associated Domains entitlement, publishes an AASA file that includes booking and check-in paths but excludes the password reset pages, and builds a router that opens the matching trip screen. Email tracking redirects are replaced with direct links plus query parameters for campaign attribution.

After release, passengers with the app installed land directly on their boarding pass in one tap, while others still reach the website. Support requests about missing passes drop noticeably during peak travel weeks.