ua-parser / uap-php

PHP implementation of ua-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

device is not detected

salarmehr opened this issue · comments

Thanks for this repository.
When I use it on my pc, device returned as 'Other' instead of PC. Is it the intended behavior?

Could you please provide your full user agent string?
Sometimes the user agent does not contain the platform (or other parts). And a missing part will resolve to the default, in your case «Other».

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36 OPR/36.0.2130.65


object(UAParser\Result\Client)#665 (4) {
  ["ua"]=>
  object(UAParser\Result\UserAgent)#669 (4) {
    ["major"]=>
    string(2) "36"
    ["minor"]=>
    string(1) "0"
    ["patch"]=>
    string(4) "2130"
    ["family"]=>
    string(5) "Opera"
  }
  ["os"]=>
  object(UAParser\Result\OperatingSystem)#670 (5) {
    ["major"]=>
    NULL
    ["minor"]=>
    NULL
    ["patch"]=>
    NULL
    ["patchMinor"]=>
    NULL
    ["family"]=>
    string(10) "Windows 10"
  }
  ["device"]=>
  object(UAParser\Result\Device)#671 (3) {
    ["brand"]=>
    NULL
    ["model"]=>
    NULL
    ["family"]=>
    string(5) "Other"
  }
  ["originalUserAgent"]=>
  string(127) "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36 OPR/36.0.2130.65"
}

I'm on the last stable version

Closing

OK. In http://useragent.mkf.solutions/?userAgent=Mozilla%2F5.0+%28Windows+NT+10.0%3B+WOW64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F49.0.2623.110+Safari%2F537.36+OPR%2F36.0.2130.65

the devise name is empty in the uaparser row and also in http://uaparser.dmolsen.com/:

  ua->family: Chrome
  ua->major: 61
  ua->minor: 0
  ua->patch: 3163
  ua->toString: Chrome 61.0.3163
  ua->toVersionString: 61.0.3163
  os->family: Windows
  os->major: 
  os->minor: 
  os->patch: 
  os->patch_minor: 
  os->toString: Windows
  os->toVersionString: 
  device->family: Other
  toFullString: Chrome 61.0.3163/Windows
  uaOriginal: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

device == other