views:

45

answers:

3

Are there different user agents for each version of the iPhone?

+1  A: 

See this: http://www.gtrifonov.com/blog/2009/04/08/IPhone_User_Agent_Strings.aspx

| Mozilla/5.0 (iPhone; U; XXXXX like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/241 Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; XXXXX like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A477c Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; XXXXX like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A477d Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A498b Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A535b Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A538b Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Kevin) Version/3.0 Mobile/1A543a Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A566a Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C9 Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C10 Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A522a Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C6 Safari/419.3 | 
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A537a Safari/419.3 |

Also, only for iPhone:

IOS Ver   HW       DeviceUserAgent
3       iPhone     Apple-iPhone/701.341
3.1     iPhone     Apple-iPhone/703.144
4       iPhone 3G  Apple-iPhone1C2/801.293
4       iPhone 3GS Apple-iPhone2C1/801.293
4       iPhone 4   Apple-iPhone3C1/801.293
4.1     iPhone     Apple-iPhone/508.11
3.0.1   iPhone     Apple-iPhone/701.400
3.1.2   iPhone     Apple-iPhone/704.11
3.1.3   iPhone     Apple-iPhone/705.18
4.0.1   iPhone 3G  Apple-iPhone1C2/801.306
4.0.1   iPhone 3GS Apple-iPhone2C1/801.306
4.0.1   iPhone 4   Apple-iPhone3C1/801.306
shamittomar
This doesn't really help. What do they mean? Do you know what iPhone version 'Mobile/241' is?!
danixd
@Danixd, OK, see the updated list now.
shamittomar
@shamittomar, thanks sorry I didn't mark this as answered earlier, I thought I did!
danixd
@danixd, You're welcome.
shamittomar
A: 

preg_match('/Apple.*Mobile.*Safari/', $_SERVER['HTTP_USER_AGENT'])

contains a safe regex for iPhone and iPod Touch

stillstanding