One QR Code on a Business Card Sends iPhones to the App Store and Androids to Google Play

QR codes that route to the appropriate app store

One QR Code on a Business Card Sends iPhones to the App Store and Androids to Google Play

When I announced PokerNexus, I mentioned a separate shortlink host for printed links. This post explains what it does: a QR code on a business card encodes a single URL, go.pokernexus.com/app, and a small Hono service reads the User-Agent header to route iPhones to the App Store, Androids to Google Play, and everyone else to the website. It covers bot detection, the iPad problem, 302s, Vary, and query strings.

A wrong answer that lands on the website is still a working page, while a wrong answer that lands in a store is an install prompt for a device that can't run the app.
  1. classictraffic

    I agree with the other commenters that this is a pretty simple engineering problem, but I still enjoyed reading about edge cases the author worked to address (they could have taken the easy road with this but tried not to). I forgot that Safari on iPad doesn't specify iPad in user agent headers

  2. Tiberium

    Is this a whole blog post for a simple backend that just routes based on the User-Agent?

  3. m4tthumphrey

    Err wut... redirecting based on user agents?

More from this day

2026-09-24