My web app using location services worked fine until I started testing "Do not allow" use cases. Now an iPhone refuses to ever allow location services, even when I answer "OK" to "Safari" would like to use your current location.
To reproduce... Using iPhone on iOS 5.1:
I kill and restart Safari, I delete all website data, I turn Location Services on and off, I even reboot, and still Safari refuses to actually Allow location services even when I say I want to.
Once you go through these steps, that web domain is dead to location services. I'm running out of domains to test
I've searched many StackOverflow, Apple Developer and other sites for answers. But it sure looks like a bug to me. Answering a prompt with "Allow" but getting denied must be a bug. After answering "Allow" the location services icon appears at the top of the screen briefly but then disappears, and in Location Services settings Safari appears with "On" and the gray icon next to it.
After trying a combination of reseting location warnings, turning on and off location services and closing and restarting the browser, I did manage to get one new error:
"The operation couldn't be completed. (kCLErrorDomain error 1.)" Sounds buggy.
I'd rather it be something silly I am doing, can anyone tell me?
Open the Privacy menu and choose the Location Services sub-menu. Enable the Location Services toggle. Scroll down on the Location Services page, and select the Safari app from the list. Choose the appropriate desired option from – Never, Ask Next Time, or While Using the App.
How to stop websites asking for location access in Safari. Head to Settings > Safari. Now go down the list and select Location. Choose Deny to prevent location access.
Scroll down and select “Safari.” Scroll down till you see the “Settings For Websites” section. Tap on “Location” in there. Select “Deny.”
Open the Settings app, then scroll down to Privacy, then here, select Location Services. Scroll down until you see “Safari Websites” and tap the icon. Here, under “Allow Location Access” you can choose from three options. The “Never” option will never share your location.
I got it after about giving up and thinking there wasn't a solution. I managed to share my location on my iPhone 4s by doing the following:
Go to Settings -> General, scroll to the bottom and go to Reset-> Reset Location & Privacy.
The next time I opened my web-app to test its user location features, it worked like a charm. Hope this helps for all who have this problem.
The following steps solved it for me:
The trick (compared to mark's answer) is to make sure you close Safari fully. When I followed mark's answer, I got the prompt re-appearing for Safari itself, but not for my domain. After closing Safari then following mark's answer, I got 2 successive prompts, firstly for Safari, and then for my domain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With