Is it possible to use iOS geolocation settings with Javascript navigator.geolocation?
When my app opens for the first time, 3 different permission popups are displayed.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(displayAndWatch, locError, {
enableHighAccuracy: false,
timeout: 8000,
maximumAge: 1000
});
} else {
alert("Your device does not support geolocation.");
}
- Allow access to Motion and Orientation (Javascript)
- Allow the app to use current location (Javascript)
- Location popup with (Never, Ask Next Time, While Using the App) - iOS
Ideally, I’d just have the traditional iOS popup that, once answered, would be used by Javascript so the user didn’t get so many redundant prompts.