Mobile applications often need to open specific screens when users click links from websites, emails, advertisements, social media, or messaging platforms. For example, clicking a product link should open that product directly inside an installed shopping application instead of taking users to the homepage.
Universal Links on iOS and App Links on Android provide a reliable way to connect website URLs with native mobile applications. Deferred deep linking extends this experience by preserving the intended destination when users need to install the application before accessing the content.
These technologies are useful for e-commerce platforms, social applications, booking systems, financial services, marketing campaigns, and subscription-based applications.
In this guide, we will explore how to build Universal Links and deferred deep linking for Android and iOS applications, including platform configuration, backend architecture, link handling, installation flows, analytics, and testing.
1. Understand Deep Linking, Universal Links, and App Links
Before implementation, it is important to understand the differences between these technologies.
Deep Linking: Deep linking allows an application to open a specific screen or piece of content using a URL or application-specific link.
Universal Links: Universal Links are Apple’s implementation of standard HTTPS links that can open the corresponding iOS application when the website and application are correctly associated.
Android App Links: Android App Links allow verified HTTPS website URLs to open directly in an associated Android application.
Deferred Deep Linking: Deferred deep linking preserves the intended destination when a user clicks a link but does not have the application installed. After installing and opening the application, the user can be directed to the original content when the required attribution or link-resolution mechanism supports it.
For example:
https://example.com/products/123
Depending on the device and application state, this link can:
- Open product 123 in the installed mobile application.
- Open the product webpage in a browser.
- Redirect the user through an installation experience.
- Restore the intended product destination after installation through a supported deferred-linking implementation.
2. Understand the Link Architecture
A cross-platform deep linking system requires coordination between the website, mobile applications, backend services, and link resolution infrastructure.
The main components include:
| Component | Responsibility |
|---|---|
| Website domain | Provides the HTTPS links |
| iOS application | Handles Universal Links |
| Android application | Handles verified App Links |
| Association files | Verify website and application ownership |
| Backend API | Resolves dynamic links and content information |
| Deferred linking service | Helps preserve destinations during installation |
| Analytics system | Tracks link clicks and application openings |
| App stores | Provide application installation destinations |
A simplified architecture looks like this:
Shared HTTPS Link
|
example.com
|
Platform Link Resolution
|
+---------+---------+
| |
iOS Android
| |
Universal Links App Links
| |
iOS Application Android App
| |
+---------+---------+
|
Deep Link Router
|
Destination Screen
|
Product / Profile / Offer
If the application is not installed, the website or link service can provide an installation experience and a supported deferred-linking mechanism.
3. Choose the Technology Stack
The technology stack depends on whether the applications are developed natively or using a cross-platform framework.
| Technology | Purpose |
|---|---|
| Swift | Native iOS development |
| Kotlin | Native Android development |
| Flutter | Cross-platform mobile development |
| React Native | Cross-platform mobile development |
| Node.js | Backend link resolution |
| Express.js | Create link management APIs |
| PostgreSQL | Store link and campaign information |
| Firebase Analytics | Track supported application events |
| Firebase Hosting | Host website association files |
| Apple Associated Domains | Configure iOS Universal Links |
| Android App Links | Configure verified Android URL handling |
For cross-platform applications, Flutter or React Native can share most of the destination-routing logic while native platform configuration remains necessary.
4. Design a Consistent URL Structure
Start by defining a URL structure that can be shared across web, Android, and iOS.
For example:
| URL | Destination |
|---|---|
https://example.com/products/123 | Product details |
https://example.com/users/456 | User profile |
https://example.com/categories/electronics | Category page |
https://example.com/offers/summer-sale | Promotional offer |
https://example.com/orders/789 | Order details |
Use HTTPS URLs on a domain controlled by your organization.
Avoid designing separate public URL formats for every mobile platform. A consistent URL structure makes links easier to share, track, and maintain.
Also define what happens when a destination is unavailable, deleted, or restricted by user permissions.
5. Configure Universal Links for iOS
Apple Universal Links allow iOS applications to open verified HTTPS URLs directly.
The implementation requires configuring the Associated Domains capability and hosting an Apple App Site Association file.
Step 1: Enable Associated Domains
Open the iOS project in Xcode.
Navigate to:
Signing & Capabilities → + Capability → Associated Domains
Add:
applinks:example.com
For a subdomain, configure it separately:
applinks:links.example.com
The domain must match the website hosting the association file.
Step 2: Create the Apple App Site Association File
Create a file named:
apple-app-site-association
The file must be hosted at:
https://example.com/.well-known/apple-app-site-association
Example configuration:
{
"applinks": {
"details": [
{
"appIDs": [
"TEAMID.com.example.myapp"
],
"components": [
{
"/": "/products/*"
},
{
"/": "/offers/*"
},
{
"/": "/users/*"
}
]
}
]
}
}
Replace the team identifier and bundle identifier with the actual application details.
The file should be served over HTTPS without an inappropriate redirect and with a valid JSON response. Apple uses this file to verify which application can handle the specified website paths.
Step 3: Handle Universal Links in iOS
When a user opens a Universal Link, iOS delivers the URL to the associated application.
A native Swift implementation can handle the incoming URL through the application lifecycle.
For example:
func scene(
_ scene: UIScene,
continue userActivity: NSUserActivity
) {
guard userActivity.activityType ==
NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL
else {
return
}
DeepLinkManager.shared.handle(url)
}
The application should parse the URL and navigate to the corresponding screen.
If the application uses a different lifecycle architecture, implement the relevant Universal Link handling entry points consistently.
6. Configure Android App Links
Android App Links provide verified HTTPS link handling for Android applications.
The configuration involves an application intent filter and a Digital Asset Links file.
Step 1: Add an Intent Filter
Open the Android manifest and configure an intent filter for the application activity.
<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>
Additional intent filters or data configurations can support other URL paths.
Using separate, carefully configured filters can make path matching easier to maintain.
Step 2: Create the Digital Asset Links File
Create a file named:
assetlinks.json
Host it at:
https://example.com/.well-known/assetlinks.json
Example:
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "com.example.myapp",
"sha256_cert_fingerprints": [
"YOUR_APP_SIGNING_CERTIFICATE_SHA256"
]
}
}
]
Replace the package name and SHA-256 certificate fingerprint with the actual production application values.
If the application uses Google Play App Signing, use the appropriate app-signing certificate fingerprint rather than assuming the local debug certificate is sufficient.
Step 3: Handle Incoming Android Links
Android delivers matching URLs through the activity intent.
Example:
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
val uri = intent.data ?: return
DeepLinkManager.handle(uri)
}
Also process the launch intent when the activity is first created. Otherwise, links that start a new application process may not be handled correctly.
7. Build a Shared Deep Link Router
After configuring both platforms, create a centralized routing system.
The router should interpret incoming URLs and identify the appropriate application destination.
For example:
type DeepLinkRoute = {
type: string;
id: string;
};
function parseDeepLink(url: URL): DeepLinkRoute | null {
const segments = url.pathname
.split("/")
.filter(Boolean);
if (
segments[0] === "products" &&
segments[1]
) {
return {
type: "product",
id: segments[1]
};
}
if (
segments[0] === "offers" &&
segments[1]
) {
return {
type: "offer",
id: segments[1]
};
}
if (
segments[0] === "users" &&
segments[1]
) {
return {
type: "profile",
id: segments[1]
};
}
return null;
}
This is a simplified example of shared parsing logic. Native applications can implement equivalent logic in Swift and Kotlin, or use a shared routing layer in Flutter or React Native.
The router should also:
- Validate URL paths and parameters.
- Reject unsupported destinations.
- Handle missing content.
- Preserve query parameters when required.
- Check authentication before opening protected screens.
- Prevent unauthorized access to private resources.
8. Implement Deep Linking in Flutter Applications
Flutter applications can implement platform deep linking through the framework’s supported routing mechanisms.
For more advanced routing, packages such as go_router can simplify URL-based navigation.
Install the package:
flutter pub add go_router
Example:
final router = GoRouter(
routes: [
GoRoute(
path: '/products/:id',
builder: (context, state) {
final productId =
state.pathParameters['id']!;
return ProductScreen(
productId: productId,
);
},
),
GoRoute(
path: '/offers/:id',
builder: (context, state) {
final offerId =
state.pathParameters['id']!;
return OfferScreen(
offerId: offerId,
);
},
),
],
);
Configure the router in the application:
MaterialApp.router(
routerConfig: router,
);
The Android intent filter and iOS Associated Domains configuration are still required for verified HTTPS links.
Flutter’s built-in deep linking behavior should be considered when choosing additional deep-linking packages. Avoid configuring multiple independent handlers that compete for the same incoming links.
9. Understand Deferred Deep Linking
Normal deep linking works when the application is already installed.
Deferred deep linking addresses a different situation: the user clicks a link before installing the application.
For example:
- A user receives a product link.
- The user clicks the link.
- The application is not installed.
- The user visits the appropriate app store.
- The user installs and opens the application.
- The application attempts to recover the original destination.
- The user is directed to the intended product.
The difficult part is preserving the original link information across the app store installation process.
Unlike standard Universal Links and Android App Links, deferred deep linking is not automatically guaranteed by the operating systems.
It requires a dedicated implementation, attribution infrastructure, or supported platform mechanism.
10. Build a Deferred Deep Linking Architecture
A deferred deep linking system generally needs a link service that stores destination information and provides a way to recover it after installation.
A typical workflow looks like this:
User Clicks Shared Link
|
Link Resolution API
|
Check App Installation
|
+-------+-------+
| |
Installed Not Installed
| |
Open App Open App Store
|
Install App
|
First Launch
|
Deferred Link Resolver
|
Recover Destination
|
Open Target Screen
The link service may generate a unique token for each link.
For example:
https://links.example.com/r/abc123
The token can reference a stored destination such as:
{
"type": "product",
"id": "123",
"campaign": "summer_sale"
}
The application resolves this information after installation, subject to the supported attribution and privacy mechanisms.
11. Implement a Deferred Link Backend
A backend service can generate and manage shareable links.
For example, create a database table:
| Table | Important Fields |
|---|---|
| deep_links | id, token, destination_type, destination_id |
| link_campaigns | id, name, source, medium |
| link_clicks | id, link_id, clicked_at, platform |
| link_installs | id, link_id, install_at, attribution_status |
| link_events | id, link_id, event_type, created_at |
Create an API to generate a link:
POST /api/deep-links
Example request:
{
"destinationType": "product",
"destinationId": "123",
"campaign": "summer_sale"
}
Example response:
{
"url": "https://links.example.com/r/abc123"
}
The backend should generate unpredictable tokens and associate them with validated destinations.
When a user opens the link, the service can record a click and return the appropriate web or app-store destination.
12. Recover the Deferred Destination After Installation
After the application is installed and opened, it needs a way to recover the original link.
There are several implementation approaches:
1. Third-party deferred deep linking services
Some attribution and deep-linking providers offer link management, installation attribution, and destination recovery.
Evaluate their current platform support, pricing, privacy requirements, and SDK lifecycle before choosing one.
2. Android Install Referrer
Google Play Install Referrer can provide installation referral information for Android applications when the installation flow and referral data are supported.
A referral parameter may contain a link token that the application sends to the backend for resolution.
3. iOS deferred-linking infrastructure
iOS does not provide a general-purpose equivalent of Android Install Referrer that guarantees arbitrary original URLs will be available after App Store installation.
Implementations generally depend on an eligible deferred-linking provider, campaign attribution mechanism, or a user-assisted continuation flow.
Do not rely on IP address, device fingerprinting, or other invasive techniques to match users across installations.
4. User-assisted recovery
If automatic recovery is unavailable, preserve the destination on a landing page and offer a continuation experience, such as an email link or QR code.
This provides a more predictable fallback without depending on unsupported device matching.
13. Use Android Install Referrer
Android Install Referrer is useful for retrieving referral information associated with a Google Play installation.
Add the Play Install Referrer dependency:
dependencies {
implementation(
"com.android.installreferrer:installreferrer:2.2"
)
}
The application can connect to the Install Referrer service and retrieve the referral details.
Simplified Kotlin example:
val referrerClient =
InstallReferrerClient.newBuilder(context).build()
referrerClient.startConnection(
object : InstallReferrerStateListener {
override fun onInstallReferrerSetupFinished(
responseCode: Int
) {
if (
responseCode ==
InstallReferrerClient.InstallReferrerResponse.OK
) {
val response =
referrerClient.installReferrer
val referrer =
response.installReferrer
// Extract the link token.
// Resolve it using the backend API.
}
}
override fun onInstallReferrerServiceDisconnected() {
// Retry according to the application's policy.
}
}
)
The actual implementation should handle connection cleanup, retries, parsing, and duplicate processing.
The referral string should contain only a token or other non-sensitive reference. The backend must validate the token before returning destination information.
14. Handle Authentication and Protected Destinations
Some deep links point to private content such as orders, invoices, account settings, or subscription information.
The application should not automatically expose protected content just because a valid link was received.
Instead, use a pending destination flow:
- Receive the deep link.
- Validate the URL.
- Store the destination temporarily.
- Check the user’s authentication status.
- If authentication is required, display the login screen.
- Complete authentication.
- Verify the user’s access permissions.
- Navigate to the intended destination.
For example, a user opening an order link should see the requested order only after the backend confirms that the account is authorized to access it.
15. Implement Link Analytics and Campaign Tracking
Deep links are valuable for measuring marketing performance and user engagement.
Track relevant events such as:
- Link created
- Link clicked
- Application opened
- Store redirect
- Installation attributed
- Deferred destination recovered
- Target screen viewed
- Registration completed
- Purchase completed
Use campaign parameters such as:
https://example.com/products/123
?utm_source=email
&utm_medium=campaign
&utm_campaign=summer_sale
Preserve relevant tracking parameters when resolving the link, but avoid placing personal or confidential information in URLs.
For accurate reporting, distinguish between directly observed link clicks, app openings, and installation attribution. These are not always equivalent events.
16. Follow Security and Privacy Best Practices
Deep linking creates additional entry points into an application. Incorrect URL handling can introduce security problems.
Important practices include:
- Use HTTPS for all application links.
- Verify website and application associations correctly.
- Validate incoming URLs before navigation.
- Allow only supported URL schemes, domains, and paths.
- Avoid accepting arbitrary redirect destinations.
- Validate link tokens on the backend.
- Apply expiration and revocation rules where appropriate.
- Protect private destinations with server-side authorization.
- Avoid storing passwords, access tokens, or sensitive data in URLs.
- Protect link-generation APIs against abuse.
- Apply rate limiting to link resolution endpoints.
- Respect applicable privacy and attribution consent requirements.
For deferred deep linking, avoid fingerprinting users or collecting unnecessary device information to reconstruct installation journeys.
17. Test Universal Links, App Links, and Deferred Deep Links
Testing should cover different installation states, operating systems, and navigation scenarios.
| Testing Scenario | Expected Result |
|---|---|
| iOS app installed | Valid Universal Link opens the correct screen |
| Android app installed | Verified App Link opens the correct screen |
| App not installed | Link opens the appropriate web or installation experience |
| App installed after link click | Deferred destination is recovered when supported |
| Invalid link | Application displays a safe fallback |
| Expired link | Backend rejects or handles the expired token |
| Protected destination | User authenticates before accessing content |
| Unsupported URL | Application does not navigate to an unintended screen |
| Multiple link clicks | Each link resolves to the correct destination |
| Application already running | Incoming link updates navigation correctly |
Also test:
- Cold application launches
- Warm application launches
- Browser address-bar navigation
- Links opened from messaging applications
- Links opened from email clients
- App store installation flows
- Different supported Android and iOS versions
Verify the association files using the appropriate Apple and Android validation tools before production release.
18. Deploy and Maintain the Deep Linking System
Production deployment requires coordination between the website domain, mobile applications, and backend infrastructure.
Before launch, verify:
- HTTPS certificates are valid.
- Apple App Site Association files are accessible.
- Android Digital Asset Links files are accessible.
- Application identifiers and signing fingerprints are correct.
- URL paths match the intended application routes.
- Backend link tokens are generated securely.
- App store URLs point to the correct applications.
- Deferred-linking behavior has been tested on real devices.
Monitor link failures, invalid destination requests, installation attribution, and navigation errors.
If an application changes its package identifier, bundle identifier, or domain association, update the relevant configuration files and release process.
19. Advanced Features to Add Later
After implementing the core deep linking infrastructure, consider adding:
- Custom branded short links
- QR-code-based deep linking
- Dynamic promotional links
- Personalized campaign destinations
- Multi-language destination routing
- Link expiration and revocation
- Link-level access controls
- Referral and invitation tracking
- A/B testing for landing pages
- Marketing attribution dashboards
- Cross-platform link management
- Automated link health monitoring
These capabilities can turn a basic linking system into a complete mobile engagement and attribution platform.
Conclusion
Building Universal Links and deferred deep linking for Android and iOS applications requires more than configuring URL handlers. It involves website-domain verification, platform-specific application configuration, centralized navigation, backend link resolution, installation attribution, and secure destination management.
Apple Universal Links and Android App Links provide verified ways to open installed applications through HTTPS URLs. Deferred deep linking requires additional infrastructure because preserving a destination across an app store installation is not automatically guaranteed by either platform.
By combining platform-native link handling with a reliable backend and appropriate deferred-linking mechanisms, businesses can create consistent mobile experiences that connect websites, marketing campaigns, and native applications.
Looking to build cross-platform deep linking or mobile application engagement infrastructure? Dotcube Technologies can help design and develop software tailored to your business requirements.
Contact Dotcube Technologies: https://www.dotcubetechnologies.com/#contact




