Git Product home page Git Product logo

Comments (6)

fadykstas avatar fadykstas commented on June 21, 2024

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

from ng-device-detector.

srfrnk avatar srfrnk commented on June 21, 2024

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

from ng-device-detector.

andychangwalker avatar andychangwalker commented on June 21, 2024

@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

from ng-device-detector.

srfrnk avatar srfrnk commented on June 21, 2024

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.

from ng-device-detector.

andychangwalker avatar andychangwalker commented on June 21, 2024

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

from ng-device-detector.

srfrnk avatar srfrnk commented on June 21, 2024

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 :)

from ng-device-detector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.