Skip to content
AppQR

Why an iPad is detected as a Mac in device redirects, and how to fix it

Short answer

Since iPadOS 13, Safari on iPad asks for the desktop version of websites by default and sends the same User-Agent as Safari on a Mac, so a server cannot tell the two apart. In the browser you can, because an iPad reports navigator.maxTouchPoints above 1 and a Mac does not. On a server, the fix is to make your Mac destination work for iPad users too, or to add a small check page for Mac visitors.

Last updated

You set up a link that sends iPhones and iPads to the App Store and Macs to a .dmg. Then someone opens it on an iPad and gets a Mac download they cannot use. Nothing is wrong with your code: the iPad told your server it was a Mac.

Why is my iPad detected as a Mac?

When Apple released iPadOS 13, Safari on iPad started asking for the desktop version of websites, so that sites built for desktop browsers would work fully. To get those sites, it sends a user agent identical to Safari on macOS. WebKit’s announcement says so directly and asks developers to use feature detection rather than the user agent. At the time, iPad mini was the exception.

Safari can still send an iPad user agent: when the visitor turns off Request Desktop Website, and in some narrow multitasking windows. So you will see both from the same device.

Safari does not send the Sec-CH-UA-Platform client hint, so there is no second header to check either.

What each device sends

Device and mode User agent contains Sec-CH-UA-Platform navigator.maxTouchPoints
iPhone, Safari iPhone; CPU iPhone OS … like Mac OS X Not sent More than 1
iPad, Safari, desktop websites (the default) Macintosh; Intel Mac OS X 10_15_7 Not sent More than 1
iPad, Safari, mobile websites iPad; CPU OS … like Mac OS X Not sent More than 1
Mac, Safari Macintosh; Intel Mac OS X 10_15_7 Not sent 0
Mac, Chrome or Edge Macintosh; Intel Mac OS X 10_15_7 "macOS" 0
Android phone or tablet, Chrome Linux; Android "Android" More than 1

The Mac version in the user agent is frozen, so Apple Silicon Macs and newer macOS releases show the same 10_15_7. Other browsers on iPad may also send a Mac user agent; test the ones your visitors use.

How do I tell an iPad from a Mac on a server?

A redirect that runs only on the server cannot see the difference. You have two options.

Make the Mac destination work for iPads too. If your Mac destination is an App Store page (apps.apple.com/...), an iPad opens it in the App Store like any other App Store link. If it is a download page rather than a file, add a line such as “On an iPad? Get it from the App Store” near the top.

Add a check page for Mac visitors only. For requests that look like a Mac, answer with a tiny page instead of a redirect. The page checks for a touch screen and moves on straight away. Other visitors still get a plain redirect. In a Cloudflare Worker, for example:

const MAC = 'https://example.com/download/mac';
const IPAD = 'https://apps.apple.com/app/id123456789';

function macOrIpadPage() {
  const html = `<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Opening</title>
<script>
  location.replace(navigator.maxTouchPoints > 1 ? ${JSON.stringify(IPAD)} : ${JSON.stringify(MAC)});
</script>
<noscript><a href="${MAC}">Mac download</a> or <a href="${IPAD}">iPad app</a></noscript>`;
  return new Response(html, {
    headers: { 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'no-store' },
  });
}

Call it where your redirect would otherwise send a Mac user agent to the Mac destination. The cost is an extra page load, a need for JavaScript, and that link-preview fetchers see a page rather than a redirect.

How do I detect an iPad in the browser?

If the decision happens on your own web page, check for touch whenever the user agent says Mac:

function isIPad() {
  const ua = navigator.userAgent;
  if (/iPad/.test(ua)) return true;
  return /Macintosh/.test(ua) && navigator.maxTouchPoints > 1;
}

Checking for Macintosh first matters: touch-screen Windows laptops and Android phones also report touch points, and they should not be treated as iPads.

Test it

  • On an iPad, open your link in Safari with Request Desktop Website on and then off. You should get the iPad destination both times if you use one of the fixes above.
  • On a Mac, open it in Safari and in a Chromium browser. Both should get the Mac destination.
  • Desktop browsers’ responsive design modes can fake an iPad user agent, but not a real iPad’s touch points in desktop mode, so test on a real device if you can.

What AppQR does

AppQR decides on its server from the request alone. It does not show a page first and does not run code on the visitor’s device, so it does not use the maxTouchPoints check.

  • An iPad that sends an iPad user agent goes to the iPhone destination, which covers iPhone and iPad.
  • An iPad asking for desktop sites sends a Mac user agent and goes to the Mac destination, or to the default if the Mac row is empty.
  • On the Business plan, a phone brand destination for iPad sends iPads that send an iPad user agent somewhere of their own. It cannot catch an iPad in desktop mode, which still looks like a Mac.

If iPad users matter to you, make your Mac destination useful on an iPad too, for example an App Store page or a download page that links to your iPad app. Test this link in the dashboard shows which address each kind of visitor gets. The limits are listed in How platform routing works.

Questions people also ask

Why does my iPad get the Mac download?

Safari on iPad requests the desktop version of websites by default, and with it sends a user agent identical to a Mac's. A redirect that reads the user agent sees a Mac and sends the Mac destination.

Can a server tell an iPad from a Mac?

Not from the request headers alone when the iPad is in desktop mode. The user agent is the same and Safari does not send client hints. Only code running on the page can check for a touch screen.

Is navigator.maxTouchPoints reliable for spotting an iPad?

It is the usual check. Macs have no touch screen, so browsers on a Mac report 0, while an iPad reports more than 1. Use it only when the user agent already says Macintosh, so touch-screen Windows laptops are not affected.

How can I make an iPad get the mobile user agent?

A visitor can turn off "Request Desktop Website" in Safari's settings, or ask for the mobile version of one site from the page menu in the address bar. You cannot change it from your side.

What does an AppQR link do with an iPad?

An iPad that sends an iPad user agent goes to the iPhone and iPad destination. One that asks for desktop sites sends a Mac user agent and goes to the Mac destination, or to the default if there is none. On the Business plan, a phone brand destination can send iPads that say they are iPads somewhere of their own.

Try it with your own links

One short link and QR code that sends each device to its own page. Free for 2 links, with no card and no time limit.