Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone version #8

Open
beradrian opened this issue Jan 16, 2013 · 16 comments
Open

iPhone version #8

beradrian opened this issue Jan 16, 2013 · 16 comments

Comments

@beradrian
Copy link

For all iPhone there is only one version detected. Usually it is important to also know the version too, especially when talking about a widely spread device, but with a fragmented market.

@octavian-sima
Copy link

There's also only one version of iPad and iPod in latest data-source file.
A better support for crawlers, bots would be useful.

@andr3i
Copy link

andr3i commented Jan 17, 2013

Subscribed to this issue, especially a better support for crawlers.

@Xabrriel
Copy link

Improving the detection of the latest stuff is really necessary guys, iPhone yes, crawlers yes. Thanks.

@esjr
Copy link

esjr commented Jan 17, 2013

The problem with all the i-Devices from our friends in Cupertino is that as far as they are concerned there is only one version of iPad, iPod, iPhone. This means that they made it so that it is impossible to tell from a User-Agent string which version of which device you are dealing with. For example it is impossible to tell from a User-Agent string whether you're dealing with an iPad or an iPad Mini. Welcome to the 'closed garden'. From a 'front' point of view, i.e. identify incoming request's device and route/format content accordingly, this is not much of an issue, except in case of the iPad Mini, but from a 'back-end' point of view, i.e. for traffic-analysis, this is indeed an issue. The only possible angle here is to use the OS and Browser parsers to increase the granularity for analysis with the additional info on the OS version, browser type and version.
With regard to the crawlers and the bots, you do have a point, although again this is only relevant from a traffic-analysis point of view. So, there I would suggest a (post)-processor which uses both the User-Agent string and the request's source IP to identify crawlers and bots and possibly add an extra property like IsBot to the devices' property dictionary.
Please note I'm not directly connected to the OpenDDR project -- I maintain a fork using identical parsers and resources -- but I am developing such a (post)-processor and will post a link to the (C#) source, also on GitHub, here once it is ready.
Hope that helps.

@beradrian
Copy link
Author

In regards to crawlers and bots, this is important not only from a traffic point of view. E.g. Google has two bot versions: one for desktop and one for mobile. It would be useful to respond with the appropriate content to each of them.

@esjr
Copy link

esjr commented Jan 19, 2013

From what I know and have seen Google's 'mobile' bots' User-Agent strings are actually the User-Agent string of the mobile device they 'emulate' followed by the Googlebot-Mobile version and the Google bot URL. As a result when such a User-Agent string is parsed using OpenDdr, it is identified as the device the bot is emulating, so that should not be a problem.
For example :

SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)

will be identified as device Samsung SGH-E250

You can test that here http://www.ducis.net/Miri/UserAgent

If you have examples where that is not the case I would very much like to know so as to see if the issue can be addressed. Feel free to contact me : seshat at ducis dot net.

@beradrian
Copy link
Author

Regarding iDevices, there's a clear difference from iPhone 4 vs 5 when it comes to the user agent string, e.g.
Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Mobile/7D11

@aitudor
Copy link

aitudor commented Jan 21, 2013

Separating iDevices is really important. Maybe this list can help: http://www.enterpriseios.com/wiki/UserAgent

@esjr
Copy link

esjr commented Jan 21, 2013

@beradrian : these numbers are the version numbers of the iOS of the device. If an iPhone 4 user upgrades to iOS 5 the User-Agent string will say : OS 5_0 However, if you want to use the OS version you can use the OSBuilder to get the device's OS. If the OS Version is 4 you can be pretty certain it's an iPhone 4, otherwise if for example the OS version is 5, it may be an iPhone 4 upgraded to iOS 5 or an iPhone 5.

@aitudor : Interesting list, I will certainly have a good look at it. However, again I must wonder how these version and build numbers change when the OS of the device is upgraded.

I understand the importance of correctly identifying iDevices and I wish I could offer a simple/quick fix solution but for the moment I see none. Maybe I will after digesting that UA fragment list. It would help if you could send me (seshat at ducis dot net) a list of all the iDevice User-Agent strings you have collected in 'the wild' for testing. If I come nearer a solution you'll be the fist to know. If only the lads and lasses at Apple would play nice with the whole of the www instead of their own proprietary eco-system we wouldn't be in this pickle...

@esjr
Copy link

esjr commented Jan 22, 2013

I did some tests and here's a good example using an iPhone 3 GS, upgraded to iOS 6.0.1 :

Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X; el-gr) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/23.0.1271.100 Mobile/10A523 Safari/8536.25

There is nothing in this UA-string that tells me it is an iPhone 3 GS.
Using the list published on Enterprise iOS, the iOS Mobile build version 10A523 identifies 4 different iPhones : 3 GS, 4 GSM, 4 CDMA and 4 S. If it were not an iPhone but and iPod, it could 'identify' 2 different iPods and if we were really unlucky and the UA-string was left by an iPad, it could be one of 7 different iPads.

Now the question is : what are the relevant differences between for example these 4 iPhones or 7 iPads. For that an UAProf would be nice...but then they don't do UAProf's in Cupertino either...
The net result is that we're being shut out.

Depending on what you are trying to achieve or what the application is, one possible work-around would be to get the relevant properties from client-side 'probes' using javascript.

To get some idea of the issues, have a look at this :

http://stackoverflow.com/questions/13248493/detect-ipad-mini-in-html5

@beradrian
Copy link
Author

Let's suppose that you have an iPhone 3GS upgraded to iOS 6.0.1. Now the question is: would you prefer to be detected as iPhone version 1 or iPhone version 6?
My personal preference is towards v6, because even though the hardware capabilities are wrongly detected, at least you have the software ones correct. If it is detected as v1, you got both of these incorrect.

@esjr
Copy link

esjr commented Jan 22, 2013

@beradrian : "iPhone version 1 or iPhone version 6" conflates device and OS version.
Maybe if you told me what you are trying to achieve, what the application is, I could be of some help, but the fact of the matter is that Apple's UA-string does not allow you to identify the correct device. You can identify the OS and browser, which are properties of the device, using the OSBuilder and BrowserBuilder, as mentioned earlier. As yet OpenDDR resources do not include specific properties of a device's OS or it's browser apart from some general ones included in the device properties.

@beradrian
Copy link
Author

How can I identify the OS version using an OSBuilder? Do you have a code sample?

@esjr
Copy link

esjr commented Feb 24, 2013

@beradrian : if you are referring to the Mobile build version (see above), the OpenDDR OsBuilder does not identify it, something like this would :

public static string IosVersion(string userAgent)
{
    string mobileVersion = string.Empty;
    Regex mobileRegex = new Regex("\\b Mobile/\\w*\\b", RegexOptions.Compiled);
    if (mobileRegex.IsMatch(userAgent)) {
        Match mobileMatcher = mobileRegex.Match(userAgent);
        GroupCollection mgroups = mobileMatcher.Groups;
        string mVersion = mgroups(0).Value;
        if (!string.IsNullOrEmpty(mVersion)) {
            string[] splitVersion = mVersion.Split(Convert.ToChar("/"));
            if (splitVersion.Length == 2) {
                mobileVersion = splitVersion[1];
            }
        }
    }
    return mobileVersion;
}

@beradrian
Copy link
Author

Unfortunately this does not have anything to do with OpenDDR. Moreover this will not work for other OSes.

@esjr
Copy link

esjr commented Mar 11, 2013

IOSMozillaSubBuilder...have a look. And if you're waiting for OpenDDR's response : don't hold your breath. Having said that, we're all looking forward to your constructive contribution ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants