BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Detecting Device OS version in OTA install (http://www.blackberryforums.com/developer-forum/178234-detecting-device-os-version-ota-install.html)

lionscribe 02-25-2009 02:03 PM

Wirelessly posted

Is it possible to setup my webscripts (PHP or Perl) to detect a device's OS version (not module number), so that it can automatically decide which software version to serve using OTA?
Lionscribe

tateu 02-25-2009 02:45 PM

If their Browser Identification is set as Blackberry then the user agent string is usually formatted like this:

BlackBerry8900/4.6.1.114 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
BlackBerry9000/4.6.0.234 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107
BlackBerry9530/4.7.0.103 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105

but they could have their Browser Identification set to Firefox or Internet Explorer and then it will not contain any Blackberry specific info.

For the Blackberry user agents above, I use this in PHP:

if (preg_match('/BlackBerry[^\/]*\/(.+) Profile/i', $agent, $matches))
and then for the above user agents
$matches[1] = 4.6.1.114
$matches[1] = 4.6.0.234
$matches[1] = 4.7.0.103

lionscribe 02-25-2009 03:54 PM

Wirelessly posted

Thanks! Will try.


All times are GMT -5. The time now is 05:53 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.