0

How can I get the CLLocationManager delegate methods, when the app gone into background,

I am new to CLLocationManager

Actually my app gets called CLLocationmanager dalegate methods when the app is running in the foreground but when the app goes into the background those are not called.

By using

[locationManager startMonitoringForRegion:region desiredAccuracy:kCLLocationAccuracyBest];

method my app get called these methods

- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region  {
    NSLog(@"Entered Region");
}
- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region  {
    NSLog(@"Exited Region");
}

How can I use the CLLocationmanagerdelegate in the appDelegate class?

Kushal Kumar
  • 173
  • 1
  • 14

2 Answers2

0

Take a look at the answer to my question as they are quite related.

Basically, creating a singleton CLLocationManager solved the problem.

Community
  • 1
  • 1
ari gold
  • 2,074
  • 3
  • 25
  • 51
0

Have you set the background modes in the app's plist to include location services?

wpearse
  • 2,422
  • 2
  • 29
  • 30
  • yes I have also same problem. And am set in the plist like "Required background modes to App registers for location updates" but not solved..can any one help?.... thanks.. – Kushal Kumar Dec 02 '11 at 18:32