What would be the User Agent string for iPhone 8, iPhone 8 Plus and iPhone X?

人盡茶涼 提交于 2019-12-07 03:54:02

问题


In a device detection, what would be the user agent for the new iPhone 8, iPhone 8 Plus and iPhone X?


回答1:


Here is the user agent string for them:

Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

Source:

The iOS 11 GM firmware model number is 15A372, which will very likely be the same as the model number of the final iOS 11.

Here is a user agent from a beta version of iOS 11, which has the AppleWebKit and Safari version number.




回答2:


As far as I know, user agent for iPhone 8, iPhone 8 plus and iPhone X are same. To detect device we need to check screen size of the device.

iPhone 8 - (750px x 1334px)

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

iPhone 8 Plus - (1242px x 2208px)

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1

iPhone X - (1125px x 2436px)

Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1



来源:https://stackoverflow.com/questions/46261031/what-would-be-the-user-agent-string-for-iphone-8-iphone-8-plus-and-iphone-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!