title: CLLocationManager notified every X meters
body: <p>I've been running on the web with this headache question for some long time, so I've decided to ask it here.
  I'm trying to create the ability to get notified when the user moved X meters from the last time I received location (repeatedly).
  Each time I receive the location, I push it to my server.
  I've set it up with <code>CLLocationManager</code> but it only works when the app is in the foreground/background but not when the app is inactive (the user removed the app by sliding it when double clicked the home key).
  I tried just using <code>[locationManager startUpdatingLocation]</code> in <code>didFinishLaunchingWithOptions:</code>.
  I tried using <code>[locationManager startUpdatingLocation]</code> same as before, but as I receive the first location, I start using region monitor, since as far as I understood online, only geofences can receive notifications when the app is inactive.
  I added <code>required Background Modes</code>for <code>app registers for location updates</code>.
  also tried adding <code>Application does not run in the background</code> to <code>NO</code>.</p>
  
  <p>When looking at the server, I get notified when the app is active(UIApplicationState == 0)/background(UIApplicationState == 2), but not for UIApplicationState == 1 (inactive).
  This is my code for reference:</p>
  
  <pre><code>- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray    *)locations
  {
  CLLocation *lastLocation = locations.lastObject;
  [self saveToServer];
  [self.locationManager stopUpdatingLocation];
  [self.locationManager startMonitoringForRegion:[[CLCircularRegion alloc] initWithCenter:lastLocation.coordinate radius:20 identifier:@"20"]];
  }
  
  - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
  {
  
  }
  
  - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region
  {
  CLLocation *lastLocation = manager.location;
  if(lastLocation)
  {
      [self saveToServer];
  
      [self.locationManager startMonitoringForRegion:[[CLCircularRegion alloc] initWithCenter:lastLocation.coordinate radius:20 identifier:@"20"]];
  }
  }
  
  - (CLLocationManager *)locationManager
  {
  if (_locationManager != nil) {
      return _locationManager;
  }
  
  _locationManager = [[CLLocationManager alloc] init];
  [_locationManager setDesiredAccuracy:kCLLocationAccuracyHundredMeters];
  _locationManager.distanceFilter = 20;
  _locationManager.pausesLocationUpdatesAutomatically = NO;
  [_locationManager setDelegate:self];
  return _locationManager;
  }
  </code></pre>
  
  <p>Thank you.</p>