Skip to content
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

iPad (6th Generation) v14.0.1 not correctly recognized #188

Open
ajafff opened this issue Dec 4, 2020 · 9 comments
Open

iPad (6th Generation) v14.0.1 not correctly recognized #188

ajafff opened this issue Dec 4, 2020 · 9 comments

Comments

@ajafff
Copy link

ajafff commented Dec 4, 2020

Using ngx-device-detector@2.0.1

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

@ajafff
Copy link
Author

ajafff commented Dec 4, 2020

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

@AhsanAyaz
Copy link
Owner

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 🙂

@ajafff
Copy link
Author

ajafff commented Dec 5, 2020

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.

@AhsanAyaz
Copy link
Owner

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.

@ajafff
Copy link
Author

ajafff commented Dec 7, 2020

I see that we might not be having the platform set to MacIntel

I just tested that. navigator.platform is actually set to iPad

@AhsanAyaz
Copy link
Owner

@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.

@sumitgsh
Copy link

sumitgsh commented May 3, 2021

Is it done !!
Would love to work on it..

@AhsanAyaz
Copy link
Owner

Hey @sumitgsh . Not yet. Feel free to raise a PR if you're interested.

@ngtanthanh
Copy link

text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants