Create a QR code that opens the App Store on iOS and the Play Store on Android.

A single QR code can route users to the correct app store based on their device.

Written By Zemtu

Last updated 6 days ago

Information

A QR code itself only stores a URL – it cannot detect which device is scanning it. To send iOS users to the Apple App Store and Android users to the Google Play Store, the QR code must point to a small redirect page that detects the operating system and forwards the user accordingly.

Explanation

How it works

  1. You host a small HTML page on your own domain (e.g. https://yourdomain.com/app or https://app.yourdomain.com/.

  2. The page reads the device's user agent and redirects to the correct store.

  3. You generate a QR code that points to this URL.

  4. When a user scans the code, they land on the redirect page and are sent to the App Store or Play Store automatically.

Advantages

  • Only one QR is needed for both platforms.

  • No third-party service required – full control over the link.

  • Free to host (e.g. your own web server, GitHub Pages, Netlify, Vercel).

  • The QR code never has to change, even if store URLs are updated later.

Own solution (recommended)

Step 1: Create the redirect page

Save the following code as index.html and replace the two store URLs with your own app links:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Opening app…</title>
  <script>
    (function () {
      var ua = navigator.userAgent || navigator.vendor || window.opera;
      var iosUrl     = "https://apps.apple.com/app/idYOUR_APP_ID";
      var androidUrl = "https://play.google.com/store/apps/details?id=YOUR.PACKAGE.NAME";
      var fallback   = "https://www.zemtu.com";

      if (/android/i.test(ua)) {
        window.location.replace(androidUrl);
      } else if (/iPad|iPhone|iPod/.test(ua) && !window.MSStream) {
        window.location.replace(iosUrl);
      } else {
        window.location.replace(fallback);
      }
    })();
  </script>
</head>
<body>
  <p>You are being redirected to the app store…</p>
</body>
</html>

Step 2: Host the page

Upload the file to a public URL, for example:

  • Your own web server or subdomain (e.g. app.yourdomain.com)

  • GitHub Pages – free, simple to set up

  • Netlify or Vercel – free tier, drag-and-drop deployment

Step 3: Generate the QR code

Use any QR code generator and enter the URL of your redirect page (e.g. https://yourdomain.com/app):

Download the QR code as PNG or SVG and use it on flyers, posters, vehicles or stickers.

Step 4: Test

Scan the QR code with both an iPhone and an Android device to make sure each one opens the correct store.

Alternatives (third-party services)

If you don't want to host your own redirect page, the following services offer "smart links" that handle device detection for you:

  • Branch.io — free tier available, very popular for app deep linking

  • Appsflyer OneLink — marketing-focused, includes attribution tracking

  • Adjust — similar to AppsFlyer, used by larger apps

  • URLgenius — simple smart links without coding

  • Linktree — basic platform detection on its mobile pages

  • QR Code Generator PRO — paid plan includes "App Store" QR codes with built-in iOS/Android routing

These services usually offer additional features such as analytics, deferred deep linking, and A/B testing, but most require a paid plan for production use.