views:

46

answers:

1

If using CLLocationManager in your app, the first time a location update is made it will pop a question to the user asking for permission to use the location service.

Now my app uses location, but not in the beginning of the app life cycle and when the user is not active with the phone. So I figure I have to get the allowance right from start. I don't think there is a way to "force" the question. How would you suggest me to do this?

A: 

Go ahead and attempt to access location information on launch by starting and stopping location updates. This is equivalent to "forcing" the question.

Justin
I was a bit fast one the checkmark. I'm doing this in the viewDidLoad://Get the location question allowance CLLocationManager *loc = [[[CLLocationManager alloc] init] autorelease]; [loc setDesiredAccuracy:kCLLocationAccuracyBest]; [loc setDelegate:self]; [loc startUpdatingLocation];But I get no popup. Any suggestions?
sebrock
The permission may have been set during a previous run. Try resetting it from Settings.app (deleting the app should also work).
Justin