I am currently working on a regional location manager function. Unfortunately, I cannot receive notifications of any border crossings that are less than 100 m. I have created areas with a radius of 20 m / 50 m or 70 m, and I always get a notification as soon as I cross the 100 m border. But I I would like to have a thinner radius - for example. 20 m, and receive a notification for this. Everything works very well if I have a range that exceeds 100 m - for example. 150m In this case, I receive a notification as soon as I enter 150 m, as expected.
I tried playing around with the "kCLLocationAccuracy" settings in the LocationManager and creating CLRegions, but they both don't seem to have any effect.
This is my code that I use:
- (void) initializeLocationManager { // Check to ensure location services are enabled if(![CLLocationManager locationServicesEnabled]) { [self showAlertWithMessage:@"You need to enable location services to use this app."]; return; } if(![CLLocationManager regionMonitoringAvailable]) { [self showAlertWithMessage:@"This app requires region monitoring features which are unavailable on this device."]; return; } self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move } - (void) setupGeoFence:(Station*)station { CLLocationCoordinate2D centerCoordinate = CLLocationCoordinate2DMake([station.gpsPosition.latitude doubleValue], [station.gpsPosition.longitude doubleValue]); CLRegion *geofence = [[CLRegion alloc] initCircularRegionWithCenter:centerCoordinate radius:[range doubleValue] identifier:station.name]; [self.locationManager startMonitoringForRegion:geofence desiredAccuracy:kCLLocationAccuracyBest]; }
Does anyone have an idea how to get notified at a closer border? Any help would be greatly appreciated.
Thanks Hamtho
source share