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 Air 2, ios 13.2 not recognized as tablet on safari #87

Closed
korengal opened this issue Nov 1, 2019 · 6 comments
Closed

iPad Air 2, ios 13.2 not recognized as tablet on safari #87

korengal opened this issue Nov 1, 2019 · 6 comments

Comments

@korengal
Copy link

korengal commented Nov 1, 2019

I just upgrade IOS version to ios 13.2 and it is not recognized as tablet on safari.

Thanks.

@fadykstas
Copy link

On iOS 13 window.navigator.userAgent in Safari on iOS 13 is same as on MacOS. Something like this:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15

the reason is because "Request Desktop Website" parameter is now enabled by default, so instead of os-ios we get os-mac on iOS 13

Indeed, while option change in Settings may be a good solution for the user, any developer can't rely on that. It is as weird as to ask the user to not to use dark mode cause your app doesn't support it instead of opt-out of it using plist.

Proposal is to add additional validation for os-mac:

const isIOS = navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1

real macs have no multi-touch support, this solution is ideal to detect iOS 13 devices which are the only multi-touch "MacIntel" devices in existence

@srfrnk
Copy link
Owner

srfrnk commented Dec 12, 2019

This would be handled with srfrnk/ua-device-detector#17

@srfrnk srfrnk closed this as completed Dec 12, 2019
@andychangwalker
Copy link
Contributor

@srfrnk Do any changes need to be made to ng-device-detector to get this working? We are using the latest release 5.1.4 and iPad Safari is reporting as a desktop device.

Thanks

@srfrnk
Copy link
Owner

srfrnk commented Aug 1, 2020

Hi @andychangwalker ng-device-detector is configured to use "ua-device-detector": "^1.1.1" so if you update your dependencies it should pick up the latest version which is 1.1.8. If a simple update fails do to that rm -rf node_modules && npm i should do the trick.
Let me know if this fails to help.

andychangwalker added a commit to andychangwalker/ng-device-detector that referenced this issue Aug 18, 2020
@andychangwalker
Copy link
Contributor

Hi @srfrnk

Sorry for the delay coming back. After checking ua-device-detector version it still wasn't working. I believe it was due to the MaxTouchPoints and Platform not being supplied by ng-device-detector so I modified the ng-device-detector code. I've created a pullrequest with my change for you to check.

Thanks

@srfrnk
Copy link
Owner

srfrnk commented Aug 21, 2020

Thanks @andychangwalker,
Looks good.
Not sure how I forgot that.
Guess that's what happens when you try too do many things at the same time :)

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

No branches or pull requests

4 participants