- πΊπ¦Ukraine AstonVictor
It's a duplicate of π User Agent Strings not matching Fixed
Any body can help out?
I use browscap API as below:
$mobile_agent = \Drupal::service('browscap')->getBrowser();
$vars['var_is_mobile']=$mobile_agent;
when I dump(var_is_mobile) , the ismobiledevice always be 0, why?
when view in Desktop, dump result:
array(15) {
["comment"]=>
string(15) "Default Browser"
["browser"]=>
string(15) "Default Browser"
["browser_maker"]=>
string(7) "unknown"
["version"]=>
string(3) "0.0"
["majorver"]=>
string(1) "0"
["minorver"]=>
string(1) "0"
["platform"]=>
string(7) "unknown"
["ismobiledevice"]=>
string(1) "0"
["istablet"]=>
string(1) "0"
["crawler"]=>
string(1) "0"
["device_type"]=>
string(7) "unknown"
["device_pointing_method"]=>
string(7) "unknown"
["parent"]=>
string(17) "DefaultProperties"
["useragent"]=>
string(121) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36"
["browser_name_pattern"]=>
string(1) "*"
}
when view in iphone, dump result:
array(15) {
["comment"]=>
string(15) "Default Browser"
["browser"]=>
string(15) "Default Browser"
["browser_maker"]=>
string(7) "unknown"
["version"]=>
string(3) "0.0"
["majorver"]=>
string(1) "0"
["minorver"]=>
string(1) "0"
["platform"]=>
string(7) "unknown"
["ismobiledevice"]=>
string(1) "0"
["istablet"]=>
string(1) "0"
["crawler"]=>
string(1) "0"
["device_type"]=>
string(7) "unknown"
["device_pointing_method"]=>
string(7) "unknown"
["parent"]=>
string(17) "DefaultProperties"
["useragent"]=>
string(133) "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"
["browser_name_pattern"]=>
string(1) "*"
}
Closed: duplicate
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
It's a duplicate of π User Agent Strings not matching Fixed