tags:

views:

86

answers:

1

Dear Developers,

Hi i have a quick question about the iphone (iOS) geolocation api's. Currenly i have a map in my application and the operating system will ask the user if it wants to allow the use of geolocations. Now thats all nice but the thing is i want to change my app when geolocations is allowed to a so called "Geo location" mode where new options are available or "standard" mode with less ui elements when permissions are not granted.

What can i use to check if permission is granted?. So basicaly is that an api that tells me permission granted yes or no.

A: 

Check CLLocationManager's locationServicesEnabled property to check the system-wide availability. Use your CLLocationManagerDelegate's locationManager: didFailWithError: method and check for a kCLErrorDenied error to see if the user denied location services.

Read Apple's [CLLocationManagerDelegate docs]1 for more.

jshier
thanks that worked.
Johnny Mast