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

Does not detect iOS on newer versions #163

Open
roblourens opened this issue Apr 5, 2021 · 4 comments
Open

Does not detect iOS on newer versions #163

roblourens opened this issue Apr 5, 2021 · 4 comments

Comments

@roblourens
Copy link

The useragent alone is no longer sufficient for detecting iOS. Seems like the general recommended technique is to check maxTouchPoints.

https://stackoverflow.com/a/58065241/129895

I don't have an iOS device to test, so I don't want to submit a PR right now, I just have a report that this isn't working for a user's iPad.

@nicoknoll
Copy link

Same issue here

@DamonOehlman
Copy link
Owner

@roblourens @nicoknoll Any chance you can both provide a bit more of an example of the kinds of things you are tailoring in your apps/sites once you know it is an iPad? Just trying to work out how a combination of UA sniffing and feature detection might be combined to help solve these use cases.

My thinking is that rather than updating detect-browser to attempt to definitively identify a particular browser, I should look to include a section of the repo that outline "recipes" for being able to detect a particular type of device should detect-browser fail to do it for you.

@jagregory
Copy link

Not one of the people you asked, but I just stumbled across this so below is one of my use cases:

  1. I allow users to record a video of themselves and upload it to my app. When viewing from a desktop (any browser) you're presented with a button to record yourself (using https://collab-project.github.io/videojs-record) and another button to upload a file you've recorded offline.
  2. On iOS, the built in file upload allows you to record yourself using the front-facing camera if you set the accept to a video format, so we choose to hide the videojs-record functionality and only use the built-in features.

To handle the behaviour in (2) we can't rely on looking for Safari because both Desktop and iOS Safari report as the same version, but have different behaviour with their input=file support. We also don't seem to be able to feature detect browser support for accept=video so we have to fall back on the maxTouchPoints.

@jagregory
Copy link

I just remembered another use case of mine: providing device specific instructions to users. With the example above the user is prompted to give permission for the site to access their camera and microphone; if they decline this access, we need to give them instructions how to change the setting later, which is quite a different set of steps for iOS vs Mac.

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