Quantcast
Viewing all articles
Browse latest Browse all 8068

Android Geolocation Failure

Hi there! I have a problem with Ti.Geolocation.getCurrentPosition() method in Android. Anytime I call this method, console display [ERROR] : GeolocationModule: (KrollRuntimeThread) [929,929] Unable to get current position, location is null

Here is my code:

if (Ti.Geolocation.locationServicesEnabled) {
        Ti.Geolocation.purpose = 'Current Position';
        Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH;
        Ti.Geolocation.getCurrentPosition(function(e){
            if ( e.error )
                alert("Code translation: " + e.code);
            else{
                alert("Ok!");
            }
        });
} else {
        alert('Please enable location services');
}
Any help? Thank you!

Viewing all articles
Browse latest Browse all 8068

Trending Articles