matomo-org / device-detector

The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.
http://devicedetector.net
GNU Lesser General Public License v3.0
2.95k stars 476 forks source link

Device type not detected #6067

Closed liviuconcioiu closed 1 year ago

liviuconcioiu commented 5 years ago

Device type is not detected for those particular user agents. It should be seen as smartphone.

angelofan commented 4 years ago

Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1

Now device type is null

Findus23 commented 4 years ago

@angelofan I also don't see any part of that user agent that says anything about which device this could be (apart from an iPhone).

angelofan commented 4 years ago

Open https://lx3rzx16x9.codesandbox.io/ on my phone, the device type is null

I copied the user agent on the phone to the computer, the device type is smartphone

angelofan commented 4 years ago

@Findus23 At least "Mobile" is included in the user agent. Doesn't it mean that it is a smartphone?

angelofan commented 4 years ago

in phone:

"device":{
  "type":"",
  "brand":"Apple",
  "model":"",
}

in pc:

"device":{
  "type":"smartphone",
  "brand":"Apple",
  "model":"iPhone",
}

Why are they different?

Findus23 commented 4 years ago

Hi,

https://lx3rzx16x9.codesandbox.io/ uses https://github.com/etienne-martin/device-detector-js which is an implementation in JS that only shares the rules list.

The PHP version detects a "deviceName" of "smartphone":

https://devicedetector.lw1.at/Mozilla%2F5.0%20(iPhone;%20CPU%20iPhone%20OS%2014_0_1%20like%20Mac%20OS%20X)%20AppleWebKit%2F605.1.15%20(KHTML,%20like%20Gecko)%20Version%2F14.0%20Mobile%2F15E148%20Safari%2F604.1

In case this is a bug with the JS implementation, I'd recommend you to open an issue there. (and indeed I can reproduce the issue on mobile safari)

etienne-martin commented 4 years ago

Thank you @Findus23, the inconsistency is due to Safari not supporting the lookbehind syntax for regexes as mentioned here in the readme: https://github.com/etienne-martin/device-detector-js#%EF%B8%8F-browser-environment

angelofan commented 4 years ago

It seems I have to integrate the device-detector into my server.

sanchezzzhak commented 3 years ago

do you have any ideas about what brand the ZL80 smartphone has?

liviuconcioiu commented 3 years ago

I think is a car tablet made by Alps (Alps Alpine https://www.alpsalpine.com/e/), but also BDF sells the exact same model under their brand. If you go to http://specdevice.com/showspec.php?id=6ae3-d410-0406-6a000033c587 and click on OS details, you will see FINGERPRINT: alps/full_flycom6580_we_m/flycom6580_we_m:6.0/MRA58K/1553934260:user/test-keys