Comments (6)
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.
This would be handled with srfrnk/ua-device-detector#17
from ng-device-detector.
@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.
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.
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.
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)
- Update project on npm HOT 1
- NPM Package
- deviceDetector return incorrect for UC Browser and Opera HOT 3
- Fail to start an unit test module with ng-device-detector dependencies HOT 1
- `device-detector` not adding classes? HOT 1
- Add Dependency to re-tree HOT 3
- Provide information from user provided UAs HOT 6
- Add android-phone and android-tablet to the device list by defining it from UA HOT 2
- chrome headless support HOT 14
- ng-device-detector error in injection HOT 2
- bower install failing on ua-device-detector HOT 8
- Example in Plunkr doesn't work HOT 1
- Detect iOS Version HOT 4
- Adopt version release automation HOT 2
- deviceDetectorProvider.addCustom not working HOT 3
- Android os_version is "unknown" HOT 1
- Feature Request: Add isAndroid() to deviceDetector Service HOT 5
- Angular breaks when trying to inject deviceDetector HOT 2
- Desktop device results on "unknown"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-device-detector.