Link Code Generator Logo
Link Code Generator

Free App Deep Link Generator

Create smart routing scripts that detect user OS and redirect to the correct app store or native app - with a web fallback URL.

This tool generates a "smart routing" webpage that detects the user's device. Embed this snippet on a blank HTML page. When a user clicks a link to this page, the script will attempt to open your native app. If they don't have it installed, they are routed to the App Store or your Web fallback.

The custom URI that opens your native application (e.g. `twitter://` or `spotify://`).

Where desktop users, or mobile users without a defined store link, will be sent.

Define your App schemes and Store URLs to generate a dynamic cross-platform routing script.

What Is an App Deep Link?

A deep link is a URL that opens a specific location inside a native mobile app rather than navigating to a web page. Deep links use custom URI schemes (like twitter://, spotify://, or myapp://profile/123) that the mobile operating system recognizes and routes to the registered app.

However, publishing a raw custom URI scheme on a web page is unreliable: if the user does not have your app installed, the browser shows an ugly "Cannot open page" error. You also cannot use a single app URI scheme to handle both iOS and Android, since users come from both platforms.

How the Smart Router Snippet Works

This tool generates a "deferred deep link" routing script. Here is what happens when a visitor lands on the page containing this snippet:

  1. The script detects the user's device via the navigator.userAgent string.
  2. If on iOS or Android and an app scheme is provided, it immediately attempts window.location.href = appScheme to open the native app.
  3. Simultaneously, a 1.5-second background timer starts as a fallback.
  4. If the app opens successfully, the browser tab goes hidden - the script detects the visibilitychange event and clears the timer. No redirect happens.
  5. If the app is not installed, the timeout fires and redirects the user to the correct App Store (iOS → Apple App Store, Android → Google Play) or web fallback URL.
  6. Desktop users are sent directly to the web fallback without attempting the app scheme.

Best Use Cases for Deep Link Routing

  • Email Campaigns: Send "Open in App" links in email that route to the correct store if the app is not installed.
  • SMS and Push Marketing: Re-engage lapsed users with a click that opens a specific in-app screen (product page, promo, user profile).
  • QR Code App Downloads: Print a single QR code that routes iOS users to the App Store and Android users to Google Play automatically.
  • Web-to-App Conversion: Convert web visitors to app users by offering a smart "Download Our App" link that routes seamlessly.

Frequently Asked Questions

Where do I find my app's custom URI scheme?

For iOS apps, the URI scheme is defined in your app's Info.plist under URL Types. For Android, it is defined in your AndroidManifest.xml in an intent filter with an android:scheme attribute. If building a React Native or Flutter app, check your linking configuration file. Example formats: myapp://, com.mycompany.myapp://.

Why does the 1.5-second timeout sometimes redirect even when the app is installed?

On some devices and browsers, the visibilitychange event fires inconsistently or with a slight delay when switching to the native app. If you experience false fallbacks, increase the timeout value in the generated code from 1500 to 2500 milliseconds. Conversely, users on slower devices may see a noticeable delay before the fallback fires.

Will this work with iOS Universal Links or Android App Links?

No. This script uses custom URI schemes, which is the simpler, more universally supported method. Universal Links (iOS) and App Links (Android) are more robust standards that require an associated-domain file on your server - they are the preferred solution for production apps. Use this script for quick prototyping, QR codes, and campaigns where setting up Universal Link hosting is not practical.

Developer tools delivered free

Deep link guides, Open Graph tips, and new dev tools - straight to your inbox.