views:

72

answers:

2

There are lots of scripts for detecting the User Agent string to detect iPhones and other mobile devices, but strangely enough, the iPhone 4's UA is the same as other versions.

My webapp has many HTML5 features that need to be displayed differently for the 326ppi screen than other resolutions.

Thanks in advance for any insight.

+1  A: 

http://www.mobilexweb.com/blog/iphone4-ios4-detection-safari-viewport

SLaks
thanks, I just need to check if window.devicePixelRatio = 2
pop850
A: 

iPhone useragent string:

Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7

Can't find anything specific to iPhone 4 I'm afraid.

You could create a prompt if they are on iPhone asking them if they are on an iPhone 4 or not before the page loads, I think that is a reasonable action.

Tom Gullen