Home Ask Login Register

Developers Planet

Your answer is one click away!

JohnGood February 2016

ios html5 geolocation - no error when browser has no rights to use geolocation

When using html5 geolocation, everything works nicely in the computer browser, but after switching to an iphone I get no error when user has phone settings set to not allow browser to use geolocation, is there any way to trigger error in such situation? navigator.geolocation.getCurrentPosition(handleSuccess, handleError) I'm using this code to get current position and my handleError is never triggered


Willian Dallastella February 2016

Did you try to validate the object navigator.geolocation ?

function getLocation() {
    if (navigator.geolocation) {
    } else {
        throw "Geolocation is not supported by this browser.";
function showPosition() {
    // my code

Post Status

Asked in February 2016
Viewed 3,745 times
Voted 10
Answered 1 times


Leave an answer

Quote of the day: live life