Skip to main content

Mobile Deep Linking & Universal Links

Implement deep linking and universal links for iOS and Android with deferred deep links, attribution, and fallback handling.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
You are a mobile deep linking specialist. Help me implement a comprehensive deep linking system for a e-commerce app on both iOS and Android.

Step 1: Define the deep link URL scheme for 15 in-app destinations. Design a consistent URI structure using both custom scheme (myapp://path) and universal links (https://app.example.com/path). Map each link to a specific screen with required and optional parameters. Create a link registry table: link pattern | target screen | required params | optional params | fallback URL.

Step 2: Configure iOS Universal Links. Create the apple-app-site-association (AASA) file with the applinks entries for app.example.com. Set up the Associated Domains entitlement in Xcode. Implement the SceneDelegate (or SwiftUI onOpenURL) handler that parses the incoming URL, extracts parameters, and navigates to the correct screen. Handle the case where the app needs to authenticate before showing the deep-linked content.

Step 3: Configure Android App Links. Create the assetlinks.json file and host it at app.example.com/.well-known/. Set up intent filters in AndroidManifest.xml for each deep link pattern with autoVerify="true". Implement the deep link handler Activity or Navigation component that parses the intent URI and routes to the correct destination. Handle the Android chooser dialog scenario when verification fails.

Step 4: Implement deferred deep linking for users who do not have the app installed. When a universal link is clicked without the app, redirect to the App Store and Play Store with a Firebase Dynamic Links alternative (Branch.io) link that stores the deep link payload. On first app open after install, retrieve the deferred payload and navigate the user to the intended destination after onboarding completes. Store the deferred context in clipboard + server-side matching during onboarding.

Step 5: Build a deep link testing and debugging framework. Create a test matrix of 20 scenarios covering: app installed (foreground, background, killed), app not installed (store redirect), authenticated vs unauthenticated user, expired or invalid links, and links with UTM parameters. Implement a debug mode that logs every deep link event (received, parsed, routed, fallback triggered) to Mixpanel.

Step 6: Set up deep link attribution and analytics. Track which deep links drive app opens, user registrations, and first purchase conversions. Pass UTM parameters from deep links to Mixpanel for campaign attribution. Generate a weekly report showing: top deep link paths, conversion rates by link source, and broken link detection.

What this prompt does

This prompt builds a complete deep linking system for an iOS and Android app, including the cases that usually break. It covers six steps: defining the URL scheme, configuring iOS Universal Links, configuring Android App Links, implementing deferred deep linking for users without the app, building a testing matrix, and wiring up attribution. The structure forces you to handle the app-not-installed and unauthenticated paths instead of assuming the happy case, which is where most deep linking work actually goes wrong.

The variables ground the system in your app. [link_count] and [custom_scheme] plus [domain] define the URI structure, [app_store] and [deferred_link_provider] shape the deferred flow, and [storage_method] decides how the deferred payload survives install. [test_count] sizes the test matrix, [analytics_platform] receives debug and attribution events, and [conversion_event] is what attribution ultimately measures. Because the AASA and assetlinks files must match [domain] exactly, getting these values precise is not optional.

When to use it

  • You are adding deep links to a mobile app and need both iOS and Android handled correctly.
  • You keep hitting issues when the app is not installed and the link should still work after install.
  • You need authenticated content to resolve deep links only after login.
  • You want the AASA and assetlinks.json files and intent filters set up properly.
  • You need a test matrix covering foreground, background, killed, and uninstalled states.
  • You want campaign attribution that traces an install back to its source link.

Example output

Expect a link registry table mapping patterns to screens, required params, optional params, and fallback URLs. The platform steps produce an AASA file plus Associated Domains setup for iOS, an assetlinks.json file plus autoVerify intent filters for Android, and handler code that parses incoming URLs. Later steps add a deferred deep linking flow using [deferred_link_provider], a test matrix of [test_count] scenarios, and an attribution plan feeding [analytics_platform]. It blends config files, handler code, and tables, with each platform's verification requirements spelled out so you know exactly which file goes where and how it is fetched by the operating system.

Pro tips

  • Define [custom_scheme] and [domain] precisely; the AASA and assetlinks files must match your real domain exactly or verification silently fails with no obvious error.
  • Keep the link registry for all [link_count] destinations explicit about required vs optional params and fallback URLs.
  • Don't skip the deferred path; choose a [deferred_link_provider] and [storage_method] deliberately, since clipboard plus server-side matching has known reliability tradeoffs.
  • Run the full [test_count] matrix rather than spot-checking; deep linking bugs hide in the killed-app and unauthenticated states.
  • Make sure UTM parameters flow through to [analytics_platform] so [conversion_event] attribution is actually traceable.
  • Test on real devices, since app-link verification behaves differently than emulators in some cases and can mask failures.

Frequently Asked Questions

Does this handle the case where the app is not installed?
Yes, that is the focus of step 4. It implements deferred deep linking that redirects to `[app_store]`, stores the payload via `[deferred_link_provider]`, and routes the user to the intended destination on first launch after install. This is the path most implementations get wrong.
Why do I need both AASA and assetlinks.json?
iOS Universal Links rely on the apple-app-site-association file, while Android App Links rely on assetlinks.json hosted at `[domain]/.well-known/`. The prompt configures both because each platform verifies link ownership differently, and a mismatch causes the chooser dialog or a browser fallback.
How does it deal with deep links to authenticated screens?
Both the iOS and Android handlers parse the incoming URL and, when the target requires login, defer navigation until after authentication completes. The deep link context is preserved so the user lands on the intended screen rather than a generic home page.
Can it attribute installs to specific campaigns?
Step 6 passes UTM parameters from deep links into `[analytics_platform]` and tracks which links drive opens, registrations, and `[conversion_event]` conversions. Accuracy still depends on your `[deferred_link_provider]` matching the click to the install correctly.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Mobile App Development Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support