One QR code for both app stores: device routing that doesn't strand iPads

Send iPhones to the App Store and Android phones to Google Play from one printed code, and why the fallback page matters more than either rule.

By The QRtoMany team5 min read

"Scan to download the app" is one of the most common reasons to print a QR code, and one of the easiest to get subtly wrong. You have two stores and one code. Printing two codes side by side with an Apple logo and an Android logo works, but it wastes space and makes people choose. It also fails the moment someone scans the wrong one.

A dynamic code can send each phone to its own store. The rules are simple. The part that needs thought is everyone the rules don't catch.

The two rules

On every scan, the phone's browser sends a description of itself, its User-Agent, and the routing reads the operating system from it. The rule set is:

  1. iPhone (operating system is iOS) → your App Store listing
  2. Android (operating system is Android) → your Google Play listing
  3. Fallback → a web page with both store badges and a line about what the app does

Try it. Pick a scan and see which rule decides it:

One code, the right app store

A code on packaging that sends iPhones to the App Store and Android phones to Google Play. Everything else, including a scan whose device can't be told for sure, gets a page with both store badges.

Rules are checked from the top. The first enabled rule that matches the scan decides where it goes, and a scan no rule matches goes to the fallback. Pick a scan or set your own, and the rule that decides it is highlighted.

  • United States (US)

Leave empty to simulate a scan whose country is unknown (a VPN, or an address that can’t be placed).

The region the scan comes from, in the country above — the code a real scan reports alongside its name. Best-effort for real scans. Leave blank to simulate as unknown.

In order of preference, the way a browser sends them — or paste a real Accept-Language header. Leave blank to simulate as unknown.

The instant of the simulated scan.

Used by rules set to "scanner's local time". Leave it blank for a scan from a location we can't place: like a real one, it's read in UTC.

More scan details — in-app browser, OS version, city, location, scan number, returning visitor, referrer

Browsers differ in what they report — see what a real scan from this one tells the edge below.

The version the device really runs. Leave blank for a current one — every phone reports some version.

A real scan reports the continent along with the country, so it's taken from the country unless you pick one.

As a scan reports it — usually the English name (Munich, not München); case and accents don’t matter. Leave blank for unknown.

For distance rules. A real scan is placed near its city's centre, and only roughly. Leave blank to simulate as unknown.

For distance rules. A real scan is placed near its city's centre, and only roughly. Leave blank to simulate as unknown.

Which of the code's counted scans this is — 1 is its first. Only scans that reach a destination count: not bots, and not scans that stop at a password or age prompt or a warning page. A scan limit of 100 serves scans 1 to 100. Real scans are counted approximately: when many people scan at the same moment some can get the same number, so a busy code may serve some past a limit or an "at most" rule. Leave it blank to simulate a scan made while the counter couldn't be read, which no scan-number rule matches.

No enabled rule here reads this, so this choice changes nothing — and a real scan of a code with these rules sets no returning-visitor cookie. Add a returning-visitor rule and scans are remembered from the moment it is published.

Leave blank to simulate this as unknown.

No version entered, so this tests a current iOS 26 — enter one to test another.

What a real scan from this device tells the edge: iOS 26.

The User-Agent this device's browser sends, which the edge reads: Mozilla/5.0 (iPhone; CPU iPhone OS 18_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1

Resolves to https://example.com/app/app-store, via "iPhone".
  1. iPhoneMatched

    OS is iOS — simulated value: iOS

    → https://example.com/app/app-store

  2. AndroidNot reached

    → https://example.com/app/google-play

Your changes stay in this tab and are gone when you leave. On your own codes, routing rules come with Pro and above, and A/B splits and rotations with Business and above.

The same routing code that resolves real scans, running in your browser. The iPad and the laptop both land on the fallback page.

The iPad problem

Look at the iPad scan. It is an Apple device, yet it doesn't reach the App Store. It lands on the fallback.

Since iPadOS 13, Safari on an iPad asks for desktop websites by default, and to get them it sends exactly the same User-Agent as Safari on a Mac, byte for byte. At the moment of the redirect, nothing in the request tells the two apart. A routing rule that guessed "iPad" would send real Mac users to the App Store; a rule that guessed "Mac" would strand every iPad.

So we don't guess. A scan like that is read as "a Mac, or possibly an iPad", and a condition only matches if it is true of both. "Operating system is iOS" is not true of a Mac, so the iPhone rule doesn't fire, and the scan falls through to the fallback.

This is why the fallback is the most important destination in the rule set. It has to work for everyone the rules don't catch:

  • iPads in Safari;
  • desktop and laptop browsers, which can reach the code as a typed or shared link rather than a scan;
  • anything unusual that doesn't announce itself.

A page with both badges and a sentence about the app works for all of them. A bare redirect to one store does not.

In-app browsers

Many scans don't open in Safari or Chrome at all. When someone scans a code from a social app's camera, or taps a shared link inside Instagram, TikTok or Facebook, the page opens in that app's built-in browser.

For store routing this mostly doesn't matter: the in-app browser still runs on iOS or Android, so the right rule still fires, as the Instagram scan above shows. If you need to treat those browsers differently, for example to send them to a page that explains how to open the link in the phone's own browser, there is a separate "in-app browser" condition for it.

The shortcut: an App download code

You don't have to write those rules by hand. An App download code asks for your App Store ID, your Google Play package name and a web page, and builds the routing for you. It does it with a single deep link rule that matches every scan, rather than one rule per operating system:

  • iPhones go to your App Store listing, Android phones to your Google Play listing.
  • Everything else goes to your web page: laptops, a real Mac, anything that doesn't say what it is.
  • An iPad in Safari goes to the App Store, not to the fallback. This is the one thing the two hand-written rules above can't do.

A plain rule has to decide at the redirect, where an iPad and a Mac look identical. A deep link doesn't have to: when there is an App Store listing to offer, that scan gets a brief page first, and a script on the page checks for a touch screen. An iPad has one and a Mac doesn't, so the iPad goes to the App Store and the Mac goes to your web page. With no App Store ID there is nothing better than the web page to offer either of them, so both go straight there with no extra page.

Two things follow from it being one rule that matches every scan:

  • The store ids and the web page live in that rule. Change them on the code's Rules tab, not in its Destination URL field, which is never reached while the rule is on.
  • A rule you add later sits below it and won't fire until you move it above. The rule builder flags it as unreachable to remind you.

Opening the app itself

As created, an App download code sends each phone to its store listing. It does not try to open your app, because the only things it was given are store ids, so the scan goes straight to the store with no page in between.

If people may already have your app, the store page is a detour. The same deep link rule can try the app first once you add an app link to it in the rule builder:

  • Universal Links (iOS) and App Links (Android) are tried first. They are ordinary https links that the phone opens in your app when it is installed and as a normal web page when it isn't, so that page should offer the download: the store listing is not reached on that platform. They are tried inside in-app browsers too, though some apps keep links in their own browser.
  • Custom app schemes and Android intents are tried next, but not inside social apps' in-app browsers. Those browsers block them, and an attempt there fails silently, leaving a blank page.
  • Otherwise the scan goes straight to the fallback: your store listing if you gave one, or your web page.

Checklist

  1. Start from an App download code unless you need something it doesn't do. It handles both stores and the iPad from two ids and a web page.
  2. If you write the rules yourself, put iOS and Android rules above anything else that might match phones, and expect iPads in Safari to reach the fallback.
  3. Make the fallback a page that works for every device, with both badges. It is not a spare destination.
  4. Add a Universal Link or App Link to the deep link rule if many of the people scanning already have the app. Without one, the code goes to the store.
  5. Test before you print. Every dynamic code has a scan simulator in its dashboard that runs the same routing code as live scans, including the iPad case.

About the author

The QRtoMany team

We build QRtoMany, a dynamic QR code service designed around one fact: a printed code can't be recalled. These posts are written from what we have built, and the numbers in them come from the product itself.

Try the routing on your own codes

Create a free account to get started, then request Pro to route your own codes — or make a static code with no account at all.

All posts
One QR code for both app stores: device routing that doesn't strand iPads · QRtoMany