Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Ti.Geolocation.locationServicesEnabled returns true when the location service is disabled on ios8.1

$
0
0

When I disable the location service, it seems Ti.Geolocation.locationServicesEnabled always returns true.

log.info("locationServicesEnabled = " + Ti.Geolocation.locationServicesEnabled);
    if(Ti.Geolocation.locationServicesEnabled){
        log.info("Adding the location event listener.");
        Ti.Geolocation.addEventListener('location', _getCurrentPositionCallback);
        locationAdded = true;
    }
Here is what the callback looks like.
var _getCurrentPositionCallback = function(evt) {
 
    log.info("=========================");
    Ti.Geolocation.getCurrentPosition(function(e){
        log.info(JSON.stringify(e));
        if(e.success){
            updateStatusParamObj.latitude = e.coords.latitude;
            updateStatusParamObj.longitude = e.coords.longitude;
        }
    ...
The output is like:
[INFO] :   [10/15/2014 11:1:6] locationServicesEnabled = true
[INFO] :   [10/15/2014 11:1:6] Adding the location event listener.
[INFO] :   [10/15/2014 11:1:6] =========================
Then it hangs there. It happened to me on both the simulator and the device. Has anyone experienced the same thing?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>