iOS devices report their firmware version in their user agent string, not the device version. Therefore, it is difficult to break down iPhones by their corresponding device versions. Take the iPhone 5 user agent string, for example, (running iOS 6.1.3):
"Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25"
And compare it to an iPhone 4 (also running iOS 6.1.3):
"Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25"
The only JavaScript-recognizable difference between iPhone devices is currently screen resolution:
- iPhone 3 and earlier versions: 480 × 320
- iPhone 4 and iPhone 4S: 960 × 640
- iPhone 5: 1136 × 640
- iPhone 6: 1334 × 750
- iPhone 6 Plus: 1920 × 1080
Because Adobe uses the device's user agent to populate mobile reports, it's currently impossible to obtain screen resolution without additional implementation. To help circumvent the limitation that iOS devices' user agent strings impose, use the following snippet of code. Pass it into a prop or eVar: