-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added phoneType function #71
base: master
Are you sure you want to change the base?
Conversation
Can you give examples of values for phone-type? |
@ThorstenBux Mobile Detect library has the following KNOWN LIMITATIONS The changes cannot be done to the script because of:
|
@hgoebl for example on Android I'd expect to get the phone type: Pixel or Nexus 6 or Galaxy S6. These values are part of the user-agent on Android and on iOS if one uses a WebKit browser. So I think it should be possible to return them. @serbanghita I don't quite understand your point. If it is a mobile phone it has a type i.e. Galaxy S6 and that type would still make it a mobile device and not a desktop device. |
@ThorstenBux ok now I really understand the problem you are trying to solve. We are going to have a solution on the next major version of Mobile Detect. Take a look at an example of regexes that are being checked in a certain context to determine the I'm going to backup what @hgoebl said, this is a good start but it's a huge task that cannot be achieved without writing tests on each step of detection. |
I'm currently discussing with Google if they could provide us their device catalog including form-factor. @ThorstenBux for which case do you need the phoneType? Just for information or in the detection logic? |
@hgoebl @serbanghita thanks for your positive response :). Unfortunately, regular expressions are one of my weak spots but if you could point me in the right direction I'm happy to support where I can. If it is only testing that would be fine as well. I'd need the phoneType mainly for information. I'm involved in the artoolkitX (https://github.com/artoolkitx/artoolkit5) project and we maintain a server with camera calibrations for a lot of Android, iOS devices and desktop (WebCam) devices. So far we only dealt with native apps on Android and iOS which made it easy to look up the phoneType and uniquely identify a specific phone series. |
@ThorstenBux thank you for sharing your use-case! This actually motivates me to go forward with the |
@serbanghita sounds good. I've done some research so far and it looks like there is nothing we can do if the client is a Firefox on mobile because the userAgent doesn't hold much information.
From that it looks like we need to focus on WebKit browsers. Let me know if/how I can support you. Cheers |
@ThorstenBux btw, I looked over the projects on GitHub and the closest I found to what you need is https://github.com/piwik/device-detector - written in PHP. |
@hgoebl @serbanghita is that the list you are looking for? Also available as google doc https://docs.google.com/spreadsheets/u/1/d/16gXm7mGsXY_wQjTsRJYQVKkIjR8c3v-MAliAiRs0E3c/pub?gid=0&single=true (thanks to @philip-lamb for the links) |
Yes @ThorstenBux this is the list. But Google has much more columns and unfortunately only exposes those few fields. We need the form-factor (tablet, phone). With this additional column, we could generate regular expressions targeting all devices with Android. Imagine that! |
Hi, I need to get the actual phone Type not only the manufacturer or vendor from the userAgent string. As it looks the type is available on WebKit phones on AndroidOS. I don't have many Android phones to test (only three) but it works on those. Also, the algorithm might not be sufficient for all cases.
I'd like to get some feedback on this proposed feature (function) for mobile-detect.js. I'm happy to adapt the code or follow another path, just let me know.
Thanks