Detect my web application is running on an iPad device - ipad

I would like to know how can I detect that my web application is running trough an iPad device, so I can do some code for iPad devices on my web application.
I'm developing a web application in .NET with C#, SQL Server and Visual FoxPro as databases.

The iPhone and the iPad both have distinct user agents.
An example would be
(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10
You can find more information and some sample code in How to Identify an Apple iPhone, iPod or iPad Visitor to Your Website.

Related

iPad vs iPad Mini User Agent

We're doing some server side device detection and need to drive ipad mini users to one page and ipad users to another.
Is there any thing that differentiates the two user agents?
iPad
Mozilla/5.0 (iPad; CPU OS 7_0_3 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B511 Safari/9537.53`
Mini
Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53
The only thing I see is the Mobile/11B511 and Mobile/11B554a, but is that a persistent value that we can work off?
Trying to do a device detection these days is hard and not reliable. I would recommend you instead of device detection to do a detection based on browser capabilities like I described it here.
Using this approach you are interested only if the browser supports a feature and you don't care about the device name/vendor.

IBM Worklight 6.0 - Reports log for Windows Phone 8 display a USER_AGENT than other environments

My team is facing some layout issues on Windows Phone 8 for our App that extensively uses JQuery 1.3.1, which by the way works like a charm on Android and iOS.
Doing some investigation we noticed the USER_AGENT column on the reports table APP_ACTIVITY_REPORT is missing a bit of info comparing to similar entries for other OS.
Android
Mozilla/5.0 (Linux; U; Android 4.1.2; pt-br; GT-N8000 Build/JZO54K)
AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0
Safari/534.30/Worklight/6.0.0
iOS
Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_2 like Mac OS X)
AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11A501
(391584416)/Worklight/6.0.0 Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac
OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11A501
(384361824)/Worklight/6.0.0
Windows Phone 8
Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0;
IEMobile/10.0; ARM; Touch; NOKIA; Lumia 720) <---- NO WORKLIGHT
STRING PRESENT
The question is more about if for some reason this /Worklight/6.0.0 segment present on both Android and iOS indicates that something is wrong with the WP8 environment, which could be affecting the performance of jQuery Mobile WP8 app in Worklight?
The "Worklight" string in the user agent is used for supporting IBM WebSphere Portal and it is not related to anything else you have mentioned re jQuery Mobile performance in Windows Phone 8.
The "Worklight" string does not appear in the Windows Phone 8 user agent because it was not implemented to be there. Again, this is of no consequence to you in regards to this question.

Chrome for iOS user agent on iPad

I have a web page that when viewed from an iOS device displays slightly different content. To detect the device in question the site looks for iPad;, iPod;, or iPhone; in the user agent string.
This works perfectly on Safari on all iOS devices. Testing with Chrome for iOS it works on iPhone and iPad 1, but not iPad 3. The web site is getting the following (unexpected) user-agent string:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10
This seems to be related to the "request desktop site" option in the chrome menu (what would be the wrench icon in desktop chrome). For my site it's disabled and seems to be locked to the desktop rather than mobile site. For other sites, it's enabled and results in a different user-agent string being sent when selected. eg: try http://ifconfig.me/all
So my questions are:
what criteria does Chrome use to decide whether to enable this option
given that Chrome has forced this site to the desktop site, how do I render iOS specific content (in my case a link using a protocol that is handled by my app)
If you'd like to test this yourself, there's a page here that simply reflects the user-agent string.
http://minicompapp.com/Home/UserAgent
The browser will switch between using the two User Agent strings based on whether you are acting as a mobile browser of masquerading as the desktop browser.
User Agent:
Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en-gb)
AppleWebKit/534.46.0 (KHTML, like Gecko)
CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3
User Agent after "Request desktop version":
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3)
AppleWebKit/534.53.11 (KHTML, like Gecko)
Version/5.1.3 Safari/534.53.10
This is only a hint to the web server about who the client is. The browser should render the received web content independently of the User Agent.

Mobile Twitter site refuses Webview as client

I'm trying to view a users tweets from my app but twitter responses with a webpage saying:
Sorry that page is not supported on mobile at this time
However if i load the same URL with mobile safari i get a nice webpage with all the tweets.
I'm using this URL: http://mobile.twitter.com/SOME_USERNAME/tweets
You can reproduce the error message by visiting the url in safari. If you use safari as developer and you set the user agent to iPhone you'll get the right page.
It seems the webview is sending different headers as User Agent:
Mozilla/5.0 (iPhone Simulator; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B176
vs
Mozilla/5.0 (iPhone Simulator; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3
Is there anything i could do about this problem?
Apperently it does work when i remove the /tweets part of the URL.
This is not really the answer to my question but it is the best option as long as nobody comes up with a better answer i'll accept this answer.

Find iPhone Model Information via Browser

Is it possible to get the model information of an iPhone hitting a web page? I've looked at the User Agent, but it doesn't seem to have this information encoded within it. Essentially, I want to do this but from a browser.
They do have different user agent strings. iPhone 4 is
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
You can find the complete list here: http://www.zytrax.com/tech/web/mobile_ids.html

Resources