0
votes

I followed the following link to get the user agent on my windows phone 8.1 device. http://dotnet.dzone.com/articles/how-get-windows-phone-user-0

The problem is that the user agent that i get back does not list windows phone 8.1 and instead returns "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 630)"

This seems to be wrong. I also tried wwww.whatsmyuseragent.com that returns "Mozilla/5.0 ( Windows Phone 8.1; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 630)"

Why am i not getting it correctly? Has anyone else faced this issue. Kindly help .

2
Why do you assume it's wrong?Panagiotis Kanavos
I've tested this on 2 windows phone 8.1 devices and i get user agent string with "Windows Phone 8" . Should it not be listed as "Windows Phone 8.1"?ashok
The user agent is sent by the browser, not inferred by the server. You can easily check the actual user agent string by using Fiddler on a desktop, or by checking the web server's log files.Panagiotis Kanavos
My requirement is to identify the phone OS based on the user agent in the server. I am checking the logs in the server and with this issue not able to differentiate which requests are coming from which OS. Is there any other way of capturing the user agent other than whats mentioned in the post?ashok
I repeat, the user agent string is sent by the browser. What you capture is the actual user agent string, there is nothing else to capture. You should be asking why a Lumia 630 reports such a string instead. Maybe the initial versions of IE on WP8.1 did report a different user string, perhaps to avoid breaking sites that expected WP8.0. FYI my Nokia 620 with the latest developer preview appears as WP 8.1 with IE 11.Panagiotis Kanavos

2 Answers

0
votes

This one is real and gave me difficulty:

Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; Microsoft; Virtual) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537

0
votes

Like whitehawk, I had problems to detect mobiles in our portal. For WP with IE, set to mobile over the Internet, I also received the "meaningful" UAS:

Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 930) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537

Whereby, if IE mobile is set to "Desktop" or the portal is called over the Intranet, I receive:

Mozilla/5.0 (Windows NT 6.2; ARM; Trident/7.0; Touch; rv:11.0; WPDesktop; Lumia 930) like Gecko

So.. the effect was, that our portal has showed the mobile page to iOS, instead of the mobile page to WP.
The workaround was to query the UAS for "Windows Phone" before the query for iPhone.
It seems as MS tries, to be detected as mobile device on this way (if a page only queries for iOS and Android-devices), what is not nice.