0

My question is about detecting ios version from server-side. Based on ios version , I will change content at cshtml. I want to check if the version is greater or equal to ios13.

Pseudo code is like this

var isIphone = ....
var iosversion = ....

if(isIphone && iosversion >= 13)
.....

I found this code

var userAgent = Request.UserAgent.ToString().ToLower();

and it retuns like below

mozilla/5.0 (iphone; cpu iphone os 13_2 like mac os x) applewebkit/605.1.15 (khtml, like gecko) version/13.0.3 mobile/15e148 safari/604.1

Ozmen
  • 129
  • 3
  • 10
  • You almost answered to yourself already. When a request is made to your server, you should check User Agent (as you pointed out). iPhones do have user agent string as you posted, so you can easily extract version of iOS (13_2 -> 13.2) from that. – markich Dec 10 '19 at 12:29
  • I saw code like "Request.Browser " so which is the best way "Request.UserAgent" or "Request.Browser " – Ozmen Dec 10 '19 at 14:25
  • UserAgent is more reliable based on my experience, so I would use that. – markich Dec 10 '19 at 18:25

0 Answers0