Skip to content Skip to sidebar Skip to footer

Html5 Geolocation - Not Working All The Time On Ios

Working currently with the HTML5 Geolocation and I've tested it on all web browsers and it seems to be working. However when I test the Geolocation on the iPad, it works for the iP

Solution 1:

I thought you should get location's permission first.

Add NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription in App-Info.plist and give it a string.

Try with above, and see if that helps.

simple for no timer

<!DOCTYPE html><html><head><scriptsrc="http://code.jquery.com/jquery-1.11.3.min.js"></script></head><body><BR><BR><BR><BR><buttononclick="getLocation()">get Location</button><script>functiongetLocation() {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(alertPosition);
            } else {
                alert("Geolocation is not supported.");
            }
        }

    functionalertPosition(position) {
        alert("Latitude: " + position.coords.latitude +
              "<br>Longitude: " + position.coords.longitude);
    }
    </script></body></html>

Post a Comment for "Html5 Geolocation - Not Working All The Time On Ios"