IOS8 Simulator User Agent

When researching why I have an error in iOS8 web browsing, I found that the User-Agent WebView:

Mozilla / 5.0 (iPhone, iPhone OS 10_9_5, like Mac OS X) AppleWebKit / 600.1.4 (KHTML, e.g. Gecko) Mobile / 12A365 (2072607680)

Because, since I am running iOS8, it should rather be:

Mozilla / 5.0 (iPhone, iPhone with 8_0_2 processor, like Mac OS X) AppleWebKit / 600.1.4 (KHTML, like Gecko) Mobile / 12A405kalturaNativeCordovaPlayer (350612576)

Of course, the iPhone does not yet work on version 10.10, so Xcode6 somehow picks up the version from Mac OS X. For iOS <iOS8, it works fine.

So, you have a solution for me how to find out if it is an iOS8 simulator or not.

So far this is my javascript method:

isIOS8 = function(){ return ( /OS 8_/.test( userAgent ) || /Version\/8/.test( userAgent ) ) && isIOS(); }; 
+6
source share
1 answer

This issue has been fixed in iOS 8.3 Simulator Runtime. This version and newer versions no longer suffer from this problem.

I suggest you look for the substrings β€œiPhone OS” and β€œAppleWebKit / 600.1.4” if you really need to determine that you are running iOS 8, but you probably shouldn't get that close to the problem. Instead, you are probably better off making a determination based on features rather than version numbers.

+1
source

Source: https://habr.com/ru/post/976269/


All Articles