Home Blog Deep Link Implementation: The Complete Developer Guide

Deep Link Implementation: The Complete Developer Guide

Deep link implementation is one of the most impactful technical decisions you can make for your mobile app. Done right, it reduces friction, improves conversion rates, and creates seamless experiences that users remember. Done poorly — or skipped entirely — it leaves money on the table and drives users away. This guide gives you everything you need: from choosing the right scheme to deploying, testing, and scaling deep links across iOS and Android.


Every time a user taps a link in an email, a push notification, or a social media post, they face a choice: land on a generic home screen or go exactly where the content is. Deep link implementation determines which experience they get.

The numbers speak clearly. According to Branch.io's mobile growth benchmarks, apps that use deep links see up to 2x higher 30-day retention compared to apps that rely on standard home-screen redirects. For e-commerce apps, properly linked product pages can increase conversion rates by 30–50%.

For SMB decision-makers, that means deep linking is not a "nice-to-have" feature added at the end of a sprint. It is a growth lever that belongs in your app architecture from day one.

Three Core Deep Linking Approaches

Before writing a single line of code, your team must choose the right approach:

1. URI Schemes — Custom URL patterns like `myapp://product/123`. Fast to implement, but they fail silently if the app is not installed. No fallback, no web preview. Good for internal navigation within a known user base.

2. Android App Links — HTTP URLs verified against your domain via a `assetlinks.json` file. Supported from Android 6.0 (API level 23) onward. They open your app directly — no disambiguation dialog.

3. iOS Universal Links — Apple's equivalent, using an `apple-app-site-association` (AASA) file hosted on your domain. Supported from iOS 9+. Falls back gracefully to your website if the app is not installed.

Most production apps combine all three. URI schemes handle internal navigation, while App Links and Universal Links manage external entry points from marketing campaigns, emails, and social platforms.


Android App Links are the recommended approach for new Android apps targeting API level 23 and above. Here is a concise step-by-step guide.

Step 1 — Define Intent Filters in AndroidManifest.xml

xml
<activity android:name=".ProductActivity">
  <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="www.yourapp.com"
      android:pathPrefix="/product/" />
  </intent-filter>
</activity>

The `android:autoVerify="true"` attribute triggers automatic domain verification. Without it, Android will show a disambiguation dialog.

Place a JSON file at `https://www.yourapp.com/.well-known/assetlinks.json`:

json
[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.yourcompany.yourapp",
    "sha256_cert_fingerprints": ["YOUR_SHA256_FINGERPRINT"]
  }
}]

Critical detail: The file must be served with `Content-Type: application/json` and must be accessible without redirects over HTTPS. Any misconfiguration breaks verification silently.

Step 3 — Handle the Incoming Intent

In your activity, read the incoming URL and route accordingly:

kotlin
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    val data: Uri? = intent?.data
    data?.let {
        val productId = it.lastPathSegment
        loadProduct(productId)
    }
}

Apple's Universal Links follow a similar pattern but use different configuration files and APIs.

Configuring the AASA File

Host the following at `https://www.yourapp.com/.well-known/apple-app-site-association` (no `.json` extension):

json
{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "TEAMID.com.yourcompany.yourapp",
        "paths": ["/product/*", "/category/*"]
      }
    ]
  }
}

From iOS 13 onward, Apple CDN-caches your AASA file. Updates may take 24–48 hours to propagate. Plan release timelines accordingly.

swift
func application(
    _ application: UIApplication,
    continue userActivity: NSUserActivity,
    restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
    guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
          let url = userActivity.webpageURL else { return false }
    return router.handle(url)
}

Best practice: Centralize URL parsing in a dedicated `Router` class. This keeps your AppDelegate clean and makes it easy to add new route patterns without touching activity or view controller code.


Deferred Deep Linking: The Missing Piece

Standard deep links only work when the app is already installed. Deferred deep linking solves this by preserving link context through the install process.

Here is how it works:

1. User taps a deep link.

2. App is not installed — user is redirected to the App Store or Play Store.

3. After installation and first launch, the app retrieves the original link context from a backend or third-party SDK.

4. The user lands exactly where they were supposed to go.

This technique is critical for paid user acquisition campaigns. Without it, every new user lands on an onboarding screen, losing the campaign context entirely.

Popular solutions for deferred deep linking include:

For most SMBs, Branch.io or a custom lightweight backend solution offers the best cost-to-value ratio.


No deep link implementation is complete without systematic testing. Bugs here are invisible in staging and catastrophic in production.

Device-Level Testing

Use ADB for Android verification:

bash
adb shell am start -a android.intent.action.VIEW \
  -d "https://www.yourapp.com/product/42" \
  com.yourcompany.yourapp

For iOS, use `xcrun simctl`:

bash
xcrun simctl openurl booted "https://www.yourapp.com/product/42"

Comprehensive Test Matrix

Run every scenario through this checklist:

Use Google's official verification tool to validate your `assetlinks.json` before shipping: https://developers.google.com/digital-asset-links/tools/generator


Even experienced teams make the same errors. Here are the most frequent ones, with their fixes:

1. Hosting the AASA or assetlinks.json behind authentication — Both files must be publicly accessible without cookies or tokens. Verify with `curl -I` before every release.

2. Not handling all entry points — Deep links can arrive via email clients, browsers, Slack, WhatsApp, and SMS. Test every channel explicitly.

3. Forgetting fallback URLs — If the app is not installed and no fallback is defined, the user sees a blank screen or browser error. Always define a web fallback.

4. Ignoring link expiry — Time-limited promotions need time-limited links. Build expiry handling into your routing layer from the start.

5. Hard-coding paths in multiple places — Define all deep link routes in a single routing registry. This prevents inconsistencies as your app grows.

6. Not tracking link performance — Every deep link should carry UTM parameters or an equivalent tagging scheme so your analytics can attribute traffic correctly.


Deep link implementation does not live in isolation. It connects directly to your email platform, CRM, push notification service, and ad attribution stack.

A practical integration pattern for SMBs:

The result is a consistent, trackable journey from first touch to conversion — regardless of channel.


Your deep link implementation should be instrumented from day one. Key metrics to track:

Set up alerts for spikes in fallback rate or route errors. A sudden increase often indicates a broken AASA file, an expired certificate, or an app update that removed a route.


For teams building at scale, structure your deep link implementation around these principles:

Teams that invest in this architecture at the start save enormous refactoring effort as their user base and marketing operations scale.


Next Steps for Your App Team

Deep link implementation is a foundational capability for any mobile app that takes user acquisition and retention seriously. Whether you are building from scratch or retrofitting an existing app, the investment pays back quickly in higher engagement and conversion metrics.

If your team needs guidance on architecture decisions, implementation specifics, or integrating deep links into a broader mobile strategy, Pilecode is ready to help. You can also browse more practical technical guides at Pilecode Blog.

Schedule a free initial consultation →


Have questions about this topic? Get in Touch.