You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I vote to reopen this issue. The documentation is a little bit sparse. With only 1 example, albeit a poor example for the user agent detection:
importDeviceDetectorfrom"device-detector-js";constdeviceDetector=newDeviceDetector();constuserAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36";constdevice=deviceDetector.parse(userAgent);console.log(device);
Typically, nobody would manually type in a userAgent string like that, it would be done via window.navigator.userAgent or other means (I'm not sure if there are other ways). Also, we shouldn't technically have to feed in the useragent ourselves, this should be detected and handled automatically by the library. However, that's by the by. What the documentation really needs is specifying whether it has any methods or ways to tell us what type of device it is. Like isMobile or isDesktop, or isTablet, just like there is in the php library. There is no reasonable way to deduce that the methods are exactly the same as in the php library.
I want to detect the phone model and OS of every mobile access to a website.
How can I use this lib for that?
Thanks
The text was updated successfully, but these errors were encountered: