views:

1473

answers:

1

I haven't think of this yet now .

Till now whenever device was asking me use location update I was allowing it .

But when now I am not allowing then it the location manager gives me kclErrorDenied and the location manager can not start again until I restart the application .

So my question is that should I give a message to restart the app to the user or is there a solution to start working the location manager again .

thanks .

The Error :
ERROR,Time,288787555.078,Function,"void CLClientHandleDaemonDataRegistration(__CLClient*, const CLDaemonCommToClientRegistration*, const __CFDictionary*)",server did not accept client registration 1
WARNING,Time,288787555.108,Function,"void CLClientHandleDaemonInvalidation(__CFMessagePort*, void*)",client 1308.0 has been disconnected from daemon
 locationManager:didFailWithError:] [Line 244] Error Denied :Error Domain=kCLErrorDomain Code=1 "Operation could not be completed. (kCLErrorDomain error 1.)"
+4  A: 

Implement - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error.

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
NSMutableString *errorString = [[[NSMutableString alloc] init] autorelease];

if ([error domain] == kCLErrorDomain) {

    // We handle CoreLocation-related errors here
    switch ([error code]) {
        // "Don't Allow" on two successive app launches is the same as saying "never allow". The user
        // can reset this for all apps by going to Settings > General > Reset > Reset Location Warnings.
        case kCLErrorDenied:

        case kCLErrorLocationUnknown:

        default:
            break;
    }
} else {
    // We handle all non-CoreLocation errors here
}

}

willi
so the os will ask this two times and if we disallow both the the time we have to restart the app , isn't it ?
hib
Yes, if the app absolutely needs the current location.
willi
No... @willi is not correct. The app will ask once. The first time. You cannot initiate a second request for permission. Apple requires you to let the user know (when they click Don't Allow) that your program will not work without Geo Location. If it is required, tell the user to relaunch the app. If your app can work without it, then go ahead and continue the app. Regardless, you must let the user know or Apple will not approve your app. ps: They *do* check this...so do it right.
Jann
@jann ok thank you i have put a message to relaunch the app
hib