Quizzr Logo

Deep Linking

Migrating from Custom URI Schemes to Universal and App Links

Learn the architectural differences between legacy custom schemes and modern verified links to improve app security and user reliability.

Mobile DevelopmentIntermediate12 min read

The Evolution of Mobile Navigation Architecture

Modern mobile development has shifted away from seeing applications as isolated silos. Today, users expect a unified experience where a link in a browser, social media post, or email transitions them directly to a specific feature inside a native app. This mechanism is known as deep linking, and it serves as the essential bridge between web content and mobile screens.

In the early days of mobile ecosystems, developers relied on custom URI schemes to handle these transitions. While effective for simple navigation, these legacy systems lacked the security and reliability required for enterprise applications. As the industry moved toward a web-first discovery model, the architecture for linking had to evolve to solve the problem of trust and identity.

Deep linking is not just a routing mechanism; it is a fundamental shift in how we perceive the boundaries between the mobile web and native application environments.

The fundamental challenge is ensuring that the operating system knows which application should handle a specific link. Without a verification layer, any application can claim a specific protocol, leading to security vulnerabilities and a fragmented user experience. Modern protocols like Universal Links for iOS and App Links for Android address these issues by creating a cryptographically verified connection between a domain and an app.

Understanding Custom URL Schemes

A custom URL scheme is a private protocol defined by the developer, such as myapp://. When the operating system encounters this protocol, it checks its internal registry to find an application that has claimed it. If a match is found, the system launches that application and passes the remaining path and parameters for processing.

The implementation is straightforward but comes with significant architectural risks. Because there is no central registry for these schemes, two different applications can register the same name. This leads to a collision where the operating system may open the wrong app or prompt the user with a confusing disambiguation dialog.

The Shift to HTTPS Verification

To solve the reliability issues of custom schemes, Apple and Google introduced verified links that use standard HTTPS URLs. These links serve a dual purpose: they function as normal web pages in a browser and as deep links for the native app. This dual-mode operation ensures that the user always reaches the intended content, regardless of whether the app is installed.

Verification is handled by the operating system during the application installation process. The system performs a handshake by fetching a specific configuration file from the web server of the domain. If the information in that file matches the credentials inside the app, the link is considered verified and trusted.

Security, Testing, and Edge Cases

Security is a primary concern when dealing with deep links because they can be used to bypass traditional authentication flows. You should never assume that the presence of a deep link implies a verified user session. Always validate session tokens or user permissions before displaying sensitive data triggered by a link.

Testing deep links requires simulating various application states. You must test what happens when the app is completely closed (cold start) versus when it is already running in the background (warm start). Use command-line tools like adb for Android or xcrun for iOS to trigger URLs without needing to send real emails or push notifications.

  • Verify that the web server serves the association file without any redirects.
  • Ensure the Content-Type header is strictly application/json.
  • Check the size of the association file, as mobile OSs often have strict limits around 128KB.

One common pitfall is the failure of the OS to update its local link database. If you change your AASA or assetlinks file, the OS may not see the changes until the user updates the app or waits for a background refresh. During development, you may need to uninstall and reinstall the app multiple times to force a re-verification.

Deferred Deep Linking

Standard deep linking only works if the application is already installed on the device. When the app is missing, the user is typically sent to the App Store or the website. Deferred deep linking solves this by passing the original link data through the installation process.

This usually requires a third-party attribution service that tracks the user from the initial click to the first app launch. The service identifies the user's device and provides the pending deep link data to the app as soon as it is opened for the first time. This ensures a smooth onboarding experience for new customers.

We use cookies

Necessary cookies keep the site working. Analytics and ads help us improve and fund Quizzr. You can manage your preferences.