clregion

Monitoring regions but location icon disappears when app is killed

流过昼夜 提交于 2020-01-13 06:59:29
问题 I have a CLLocationManager contained in a singleton and I have added around a dozen regions to monitor. I am successfully notified of boundary crossings when the app is in the foreground/background. However, when I force quit the app, the location icon disappears and I am not getting any callbacks. 回答1: As far as I can see, this is intended functionality as of iOS7. Here is a reply I found to a similar question, in this case involving significant location change: https://devforums.apple.com

Region monitoring current location doesn't notify on exit

你说的曾经没有我的故事 提交于 2019-12-31 13:13:09
问题 I'm trying to test region monitoring, for that I'm getting current location like this: - (void)startLocationTracking { CLLocationManager *locationManager = [[CLLocationManager alloc] init]; // Start location manager if ([CLLocationManager locationServicesEnabled] && [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized) { locationManager = [LocationTracker sharedLocationManager]; locationManager.delegate = self; [locationManager startMonitoringSignificantLocationChanges]

How can I disable any CLRegion objects registered with -startMonitoringForRegion?

允我心安 提交于 2019-12-29 04:31:07
问题 I am using a NavigationController to display a list of geo-fences available to the user. At the top there is a global on/off switch that I would like to use to disable any fences registered with CoreLocation -startMonitoringForRegion. My fences seem to be registering ok and working for the most part, but no matter how many times I disable the fences individually, I'm still getting the purple location arrow indicating that the system is still monitoring my location and/or fences. When I

iOS Geofence, how to handle when inside region when monitoring starts?

五迷三道 提交于 2019-12-21 09:21:58
问题 I have been unable to work out how to handle a scenario where the phone is already inside a region when startMonitoringForRegion is called? Other questions have suggested calling requestStateForRegion inside didStartMonitoringForRegion this then calls the method didDetermineState: forRegion: . So the code looks something like this: - (void)viewDidLoad { //location manager set up etc... for (Object *object in allObjects){ CLRegion *region = [self geofenceRegion:object]; [locationManager

How to properly set the Radius of CLRegion?

邮差的信 提交于 2019-12-11 06:58:52
问题 This is my code for creating a geofence: Geofence *geofence = [[Geofence alloc] init]; [geofence setRadius:100.0]; [geofence setIdentifier: @"Fence1"]; [geofence setLocation:currentlocation]; CLRegion *region1 = [[CLCircularRegion alloc] initWithCenter:[geofence.location coordinate] radius:geofence.radius identifier:geofence.identifier]; region1.notifyOnEntry=YES; region1.notifyOnExit=YES; [self.locationManager startMonitoringForRegion:region1]; I could say that, the above code works, meaning

iOS Region Monitoring not working

寵の児 提交于 2019-12-10 11:34:00
问题 I have been doing some iOS development for a couple of months and recently I am developing a bus app. I am currently mimicking the bus' movements and set up multiple annotations on the bus stops. For test purposes, I have setup just one bus stop and am trying to monitor when the bus has entered this region and exited as well. Strangely, my didStartMonitoringForRegion method is called perfectly but neither the didEnterRegion nor didExitRegion methods are called. Every time I run the program,

Is geofence accuracy dependent on locationManager’s accuracy or distance filter?

倖福魔咒の 提交于 2019-12-10 10:44:11
问题 Is geofence accuracy dependent on locationManager’s accuracy or distance filter? Or they are independent of each other because geofence is managed by the OS and uses Wifi/Cell tower info? For example: locationManager locationManager.distanceFilter = 1250; locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; region let title = "Lorrenzillo's" let coordinate = CLLocationCoordinate2DMake(37.703026, -121.759735) let regionRadius = 550.0 let region = CLCircularRegion(center:

Location Manager stopMonitoringForRegion Not Working

左心房为你撑大大i 提交于 2019-12-08 19:14:32
问题 An app I'm working on currently sets up region monitoring with the user's current location when the app is backgrounded. When the app becomes active again I am trying to stop monitoring for the region, but it seems to work intermittently with the majority of the time resulting in it failing to act as expected. When the app is backgrounded, I start monitoring for the region and it works fine when I log the details: - (void)locationManager:(CLLocationManager *)manager

Deprecated CLRegion methods - how to get radius?

自古美人都是妖i 提交于 2019-12-08 17:15:02
问题 I'm using the geocodeAddressString:completionHandler: method, which returns an array of CLPlacemarks. I have to get latitude, longitude, mnemonical name and radius. While getting the first 3 is easy: double lat = placemark.location.coordinate.latitude; double lng = placemark.location.coordinate.longitude; NSString *name = [NSString stringWithFormat:@"%@", ABCreateStringWithAddressDictionary(placemark.addressDictionary, NO)] I don't know how to get the radius now, as placemark.region.radius is

Reducing the threshold of didEnterRegion

点点圈 提交于 2019-12-08 05:14:03
问题 I'm currently working on an app that I want for my app to detect a beacon in background mode just when it gets close to it(Immediate). Based on articles that I've read it cannot be done with didEnterRegion and I should use ranging while it's running in the background mode(Location Update). is there any solution that directly reduces the didEnterRegion threshold? or Should I use the other method? and if that's the case does it work like didEnterRegion but with a limited range of RSSI? does it