ngx-device-detector
ngx-device-detector copied to clipboard
iPad (6th Generation) v14.0.1 not correctly recognized
Using [email protected]
Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15
Firefox Daylight 29.1: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15
Both give the following results:
device: Unknown
, expected iPad
deviceType: tablet
os: Mac
, expected iOS
browser: Safari
(that's fine for me to not be able to distinguish between Safari and Firefox)
works on
Chrome: Mozilla/5.0 (iPad; CPU OS 14_0 like Max OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/86.0.4240.93 Mobile/14E148 Safari/604.1
Edge: Mozilla/5.0 (iPad; CPU OS 14_0_1 like Max OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 EdgiOS/44.11.15 Mobile/14E148 Safari/604.1.15
Idea for a possible solution: It seems like you cannot get the information from the UserAgent. IIRC you can distinguish iPad and Mac by checking for multi-touch support (iPad has it, Mac doesn't): https://stackoverflow.com/a/58979271
Hey @ajafff . Thanks for reporting this with the details 👍
We're already checking the touchpoints in our code. However, I see that we might not be having the platform
set to MacIntel
maybe, otherwise it should work actually.
Did you test this on a real device or simulator or chrome emulator?
If you can, feel free to raise a PR. If not, I'm probably gonna look into this soon 🙂
This was tested on a real device.
I tried to contribute a fix. Unfortunately I don't understand what's going on in the code. For example, I don't know how the condition on line 72 could ever be true.
Ahan. I'm gonna see if this is the same on my iPad 2. If it isn't the same, then wouldn't be able to test it unfortunaly.
I see that we might not be having the
platform
set toMacIntel
I just tested that. navigator.platform
is actually set to iPad
@ajafff then that's the cause. We can add this to the code then. I'm gonna try to get it done and released soon. Feel free to share a PR if you got time. I'll do it otherwise as soon as possible.
Is it done !! Would love to work on it..
Hey @sumitgsh . Not yet. Feel free to raise a PR if you're interested.
text