The user wants a comprehensive overview of "Mobile deep/universal linking."
The specific keywords provided are:
- Routing (Handling the link once it hits the app)
- Verification (Ensuring the link belongs to the app/website)
- Attribution (Tracking where the user came from)
- Fallbacks (What happens if the app isn't installed)
I need to structure the response to cover these four pillars clearly, distinguishing between iOS (Universal Links) and Android (App Links), while also addressing the general concept of "Deep Linking" (custom URI schemes).
1. Introduction:
- Define Universal Links (iOS) and App Links (Android).
- Contrast with "Traditional" Deep Links (custom schemes like
myapp://).
- Why this matters: User experience (UX) and security.
2. Routing (The "How it works" inside the app):
- Concept: The OS passes a URL to the app. The app needs to parse it and show the right content.
- Mechanism:
- iOS:
NSUserActivity (continueUserActivity) or UIApplicationDelegate.
- Android:
Intent filters, parsing data within the Activity.
- Routing Libraries: Mention tools like React Navigation, Flutter Deep Linking, or native router frameworks.
3. Verification (The Security/Trust layer):
- Concept: How does the OS know
example.com actually wants to open com.example.app? Prevents link hijacking.
- iOS (Universal Links):
apple-app-site-association (AASA) file. Hosted at /.well-known/.... Needs HTTPS. Apple validates from their cloud (caching issues).
- Android (App Links):
assetlinks.json file. Hosted at /.well-known/.... SHA256 fingerprints. Verification happens at install time (mostly).
- The "Verified" badge: Discuss how this removes the disambiguation dialog (the "Open with..." menu) on Android.
4. Attribution (The Marketing/Analytics layer):
- Concept: Passing data (campaign ID, referrer, product ID) through the link.
- Mechanisms:
- URL Parameters (
?utm_source=...).
- Deferred Deep Linking: The holy grail. User clicks link -> App not installed -> Goes to App Store -> Installs -> Opens App -> App knows the original link context.
- Tools: Branch, Adjust, AppsFlyer, Firebase Dynamic Links (deprecated, but worth noting context). They use fingerprinting or packet capture to bridge the Store gap.
5. Fallbacks (The "Safety Net"):
- Concept: What if the user doesn't have the app?
- Universal/App Links: Since they are https:// links, they just open the browser (web page) if the app isn't installed or isn't verified. This is the built-in fallback.
- Custom Schemes (
myapp://): These fail ugly (error page) if the app is missing.
- JavaScript Fallbacks: The "Intent" scheme on Android or
setTimeout hacks on iOS (mostly obsolete now due to Universal Links, but relevant for context).
- Redirect Logic: App Store vs. Play Store vs. Web fallback.
6. Comparison Summary (iOS vs. Android):
- Quick table or bullet points to clarify the naming differences (AASA vs. assetlinks).
7. Current Trends/Issues:
- iOS 13+ AASA caching changes (very important).
- Facebook/Instagram browsers (in-app webviews) often break or restrict universal links.
- Privacy changes (IDFA, SKAdNetwork) affecting attribution accuracy.
Structure Plan:
- Title: Mobile Deep Linking & Universal Links Architecture
- Section 1: The Basics (Definitions: Custom Schemes vs. Universal/App Links)
- Section 2: Verification (AASA & assetlinks.json)
- Section 3: Routing (Native handling)
- Section 4: Attribution (Marketing data & Deferred Deep Linking)
- Section 5: Fallbacks (Web vs. Store)
- Section 6: Third-Party Solutions (Why Branch/Appsflyer exist)
Refinement during drafting:
- Self-Correction on Verification: Make sure to emphasize that verification happens server-side (file hosting) but is checked client-side/OS-side.
- Self-Correction on Routing: Don't get too bogged down in code syntax, keep it architectural.
- Refinement on Fallbacks: Explicitly mention the "Deferred Deep Linking" challenge, as that's the hardest part of fallbacks.
Drafting Content (Mental Draft):
- Verification: iOS checks AASA. Android checks assetlinks.
- Routing: App receives URL -> Router matches path
/product/123 -> Screen Product with ID 123.
- Attribution: Click
https://site.com/item?ref=email -> App gets ref=email.
- Fallbacks: No app?
https:// opens Safari/Chrome.
Final Polish: Use clear headings, bold text for key terms, and a professional tone. Ensure the distinction between "Deep Linking" (the broad term) and "Universal/App Linking" (the specific OS-handled standard) is clear.
Let's write it out.
Here is a comprehensive breakdown of Mobile Deep and Universal Linking, structured by the four key pillars you requested: Verification, Routing, Fallbacks, and Attribution.
1. The Concept: URI Schemes vs. Universal Links
Before diving into the pillars, it is important to distinguish between the two types of links:
- Custom URI Schemes: (e.g.,
myapp://product/123)
- Mechanism: The OS registers an app to handle a specific protocol prefix.
- Pros: Easy to set up; works on all OS versions.
- Cons: No ownership verification (any app can claim
myapp://); prompts a "Open with?" dialog; fails gracefully (shows error) if the app isn't installed.
- Universal Links (iOS) / App Links (Android): (e.g.,
https://www.mywebsite.com/product/123)
- Mechanism: Standard HTTPS web links that the OS intercepts and redirects to the app based on a verified association file.
- Pros: Secure (verified ownership); seamless UX (no dialog); robust fallbacks.
- Cons: Complex setup; requires backend hosting.
2. Verification (Security & Ownership)
Verification is the process by which the Operating System (OS) confirms that your app has permission to open links belonging to a specific domain. This prevents malicious apps from hijacking your traffic.
iOS (Universal Links)
- File:
apple-app-site-association (AASA).
- Location: Hosted at
https://<your-domain>/.well-known/apple-app-site-association.
- Process:
- You upload a JSON file to your server containing your Apple Team ID and Bundle ID.
- When the app is installed, iOS pings your server to download this file.
- Important: iOS aggressively caches this file. Changes can take 24-48 hours to propagate. Apple's CDN scrapes this; your server must serve it with valid TLS/SSL and a valid Content-Type.
Android (App Links)
- File:
assetlinks.json.
- Location: Hosted at
https://<your-domain>/.well-known/assetlinks.json.
- Process:
- You upload a JSON file containing your app's SHA-256 fingerprint.
- Verification usually happens at app install time.
- Verification Failure: If verification fails (e.g., file missing, hash mismatch), the links revert to behaving as standard web links (opening the browser) or showing a disambiguation dialog.
3. Routing (Handling the Data)
Once the OS opens the app, the app receives the URL payload. The app must parse this string to determine which screen to render.
Native Handling
- iOS: The system calls
application(_:continue:restorationHandler:) in your AppDelegate or scene(_:continueUserActivity:) in your SceneDelegate. The URL is inside the NSUserActivity object.
- Android: The system launches an Intent. You retrieve the URL via
getIntent().getData().
Routing Logic
Raw string parsing is brittle. Most modern apps use a Routing Router/Navigator.
- Pattern Matching: Map
https://example.com/product/:id to ProductViewController.
- Deep Link Payloads: Extract query parameters (e.g.,
?promo_code=summer) to pre-fill UI elements.
- Universal Routing: A single router should handle both web links and internal app logic to ensure consistency.
4. Fallbacks (The User Experience)
What happens if the user clicks a link but doesn't have the app installed?
5. Attribution (Marketing & Deferred Deep Linking)
This is the most complex pillar. Attribution answers: "Which ad campaign brought this user?" and Deferred Deep Linking allows a user to click a link -> install the app -> open the app directly to the specific content.
The "Gap" Problem
Native Universal Links do not support deferred deep linking out of the box. If a user clicks a Universal Link without the app, they go to the web. If they install the app later, the app has no memory of that click.
How to Solve It (MMPs & Fingerprinting)
Most companies use Mobile Measurement Partners (MMPs) like Branch, AppsFlyer, Adjust, or Kochava.
- Click Recording: The link click is recorded on the server along with the IP address and User Agent.
- The Redirect: The user is sent to the App Store.
- App Open: When the app opens for the first time, it sends the device's IP/User Agent to the MMP server.
- Fingerprinting/Matching: The server matches the install data with the click data.
- Payload Delivery: The server returns the original routing data (e.g.,
product_id: 123) to the app, allowing the app to route the user to the correct screen immediately after the onboarding/signup flow.
iOS Private Relay (iCloud)
Note: Apple's iCloud Private Relay masks IP addresses, making server-side IP matching (fingerprinting) difficult. Attribution providers now rely heavily on probabilistic modeling or rely on StoreKit 2.0 data where available.
Summary Checklist
| Feature | iOS (Universal Link) | Android (App Link) | Custom Scheme (myapp://) |
|---|
| Verification File | apple-app-site-association | assetlinks.json | None |
| Security | High (Cryptographic) | High (SHA256 Hash) | Low (Spoofable) |
| Fallback | Opens Website (HTTPS) | Opens Website (HTTPS) | Error / Dialog |
| Setup Difficulty | High | Medium | Low |
| Best For | Marketing, Social Sharing | Marketing, Social Sharing | Internal Interop |