Determine iOS device type with ActionScript 3.0

Since I couldn’t find any articles offering the following solution to the problem of figuring out what specific iOS device an AIR app is running on I figured I’d post this short one.

For a current project I need to know what version of the iPad an AIR app is running on. I saw solutions measuring screen resolutions to get info whether an app runs in iPhone or iPad, but no posts on differentiating between iPad 1 and iPad 2. The Capabilities class seems to have the solution. Below is the output of the

property for the iPhone 4, iPad 1 and iPad 2.

iPhone 4 gives you:
iPhone OS 5.0 iPhone3,1

iPad 1 gives you:
iPhone OS 4.2.1 iPad1,1

iPad 2 gives you:
iPhone OS 5.0 iPad2,1

This info breaks down into:

  • The OS (the name apparently always is iPhone OS) with it’s version number (the iPad one in my case still running iOS 4)
  • The device id which holds the device name and the device ID

The device name and its ID apparently are different as for example the System Status reports. System Status for instance has “iPhone 4″ listed as being the Device and “iPhone3,1″ as the Device ID. The device IDs for the iPad are more descriptive, but once you know what to look for it does not really matter what it lists I guess…

Anyone have the info for the iPhone 3?

Tags: , ,

Comments are closed.