-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I guess we all know there is no way to tell from a user-agent string
which version of iPad or iPhone we're dealing with.

Some feel that getting the iOS build version from the ua-string might
help them along : http://www.enterpriseios.com/wiki/UserAgent

So, in order to accommodate that 'request' I added it to my fork of
the OpenDDR IOSMozillaSubBuilder.
I thought maybe it would be nice-to-have in the OpenDDR/DMap version too.
So, below is a quick and dirty summary of the C# code that can be
included in the IOSMozillaSubBuilder Build method.
I include the build version as "BuildVersion" in the IBuilder property
dictionary.

Regex buildReg = new Regex("\\b Mobile/\\w*\\b", RegexOptions.Compiled);
if (buildReg.IsMatch(userAgent)) {
  Match mobileMatcher = buildReg .Match(userAgent);
  GroupCollection groups = buildReg.Groups;
  string buildVersion = groups(0).Value.Split(Convert.ToChar("/"))[1];
}

esjr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRLdCmAAoJEOxywXcFLKYcq+sH/A1yonlNTTrBrk96Q53f37ns
My4FOTvc7v9wXblRM0dG0yxxaFBaTTDXf5zkgt3rPyJqeCuvI8L8XWbtN6+JG8A2
ERpjnKFrVI2I2lIG3uK3fbQY5Oh0QhDZsgfA1ZFXUcZB3sMIapOCKXn+jYXlZFYe
HUMEub74GQhLruXnGj4/pM79RKNYzC4yvinvIAIAVLJmlQi4Ja/ZPCiG74wlCt8W
dt1ZoLhtbwNAa1sT4qgMW/ZkPH3yLtP28gkwSvTSAvn7Suk8bmeIfL9WSsAYatUl
q2l7nKgM7XLH6bHt0lDpno8/vlgqqzyxHG6YMYWgLvBREyifiUGrcd0Jgo250+U=
=istv
-----END PGP SIGNATURE-----

Reply via email to