3

We're doing some server side device detection and need to drive ipad mini users to one page and ipad users to another.

Is there any thing that differentiates the two user agents?

iPad

Mozilla/5.0 (iPad; CPU OS 7_0_3 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B511 Safari/9537.53`

Mini

Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53

The only thing I see is the Mobile/11B511 and Mobile/11B554a, but is that a persistent value that we can work off?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
HjalmarCarlson
  • 868
  • 2
  • 17
  • 34
  • 1
    The `11B554a` and `11B511` are related to the iOS version, not the device. – rmaddy Jan 14 '14 at 17:59
  • 1
    possible duplicate of [Detect iPad Mini in HTML5](http://stackoverflow.com/questions/13248493/detect-ipad-mini-in-html5) – raina77ow Jan 14 '14 at 18:01

1 Answers1

0

Trying to do a device detection these days is hard and not reliable. I would recommend you instead of device detection to do a detection based on browser capabilities like I described it here.

Using this approach you are interested only if the browser supports a feature and you don't care about the device name/vendor.

Community
  • 1
  • 1
Alexandru Guzinschi
  • 5,675
  • 1
  • 29
  • 40
  • Google, Twitter and Facebook all do user agent detection. – Drew Baker Nov 26 '14 at 19:32
  • @DrewBaker Depends on the context. Using user agent for providing different html is not the best reason to do this. There are better ways to target multiple devices, like feature detection (*the link from my response is an example*), graceful degradation and progressive enhancement. – Alexandru Guzinschi Nov 26 '14 at 20:42
  • Yes everyone says that, but in reality all the big guys use UA detect. – Drew Baker Nov 26 '14 at 22:05
  • @DrewBaker Did you actually have the opportunity to work with "*all the big guys*" from the industry and you checked their code base, or that is just an assumption ? And "*big guy*" does not imply a better code base and/or better approach. – Alexandru Guzinschi Nov 27 '14 at 12:06
  • 1
    *And "big guy" does not imply a better code base and/or better approach.* – Having worked with many of the "big guys" I can confidently state that the size of the company is almost always **inversely** proportional to the quality of the codebase. – Scott Jan 05 '15 at 16:39