Search code examples
iosgpsgeolocationtitanium

Geolocation module in IOS?


In titanium studio we are using "Ti.geolocation" module for location based functions. So in the program we are checking that

if(Ti.geolocation) {

//code here

}
else{
 //code here
}

so that "geolocation" module is enabled for the app. My question: Is there any module available in Native IOS similar to Ti.geolocation so that i can check geolocation module is available or not, (other than "locationServicesEnabled" method because i dint mean this one)


Solution

  • No. You have to use locationServicesEnabled method:

    if ([CLLocationManager locationServicesEnabled]) {
        //code here        
    }
    else{
        //code here
    }
    

    Take a look at the CLLocationManager's documentation.