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

Geolocation iOS #41

Closed
donaldparker opened this issue Dec 13, 2023 · 7 comments
Closed

Geolocation iOS #41

donaldparker opened this issue Dec 13, 2023 · 7 comments

Comments

@donaldparker
Copy link

Loads in the browser but not in the PWA.

@DannyMoerkerke
Copy link
Owner

What do you mean?

@qn0361
Copy link

qn0361 commented Jan 5, 2024

image

image

@DannyMoerkerke
Copy link
Owner

What platform, device and browser + version?

@qn0361
Copy link

qn0361 commented Jan 5, 2024

in my case the solution was: https://stackoverflow.com/a/73566334
(change safari sites settings)

maybe it can help the issue's author too.

i would suggest to directly mention that in the message in the app. it's not so obvious that you should change safari geo settings – not the settings of whatpwacandotoday app nor enabling geo services in general.

i mean it becomes obvious when you think about how it works under the hood. but a little extra transparency won't hurt in my opinion.

@DannyMoerkerke
Copy link
Owner

Thanks for reporting, I'm currently investigating this. In your screen shot the dialog is shown when permission is denied but on my iOS device I notice there is nothing showing when Location Services for Safari websites is set to "Ask Next Time or When I Share".
When I then try in Safari, I do get the permission prompt and when I give permission the setting is automatically changed to "While Using the App" and after that it also works in the PWA.

In your solution, did you set a timeout in the options object for navigator.geolocation.getCurrentPosition and then Promise.race with a setTimeout with a slightly longer timeout?

@DannyMoerkerke
Copy link
Owner

@qn0361 I managed to fix the issue, can you please check on your side?

@DannyMoerkerke
Copy link
Owner

Issue fixed, no confirmation from OP

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

3 participants