Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLLocationManager startUpdatingLocation vs startMonitoringSignificantLocationChanges

I am working on a web application that enables users to login to the app, only if they're in certain specified regions. I called locationManager startUpdatingLocation at the beginning of my app to get the user's location and enables/disables logging in.

Once the user is logged on, I called

[locationManager stopUpdatingLocation];
[locationManager startMonitoringSignificantLocationChanges];

and logs the user out when the updated location is outside of the region. Would using the two methods clash in any way? (I'm testing the code on the simulator therefore the location is always the same).

Note: I'm not using didEnterRegion or didExitRegion because everything is handled by an existing Javascript code. I'm only sending in the user's current location.

like image 649
dee Avatar asked Sep 13 '11 19:09

dee


1 Answers

It really depends on what you need with the location after the user logs in. When you monitor for significant changes, your locationManager will only be notified on major changes. (e.g. New cell tower, change in wifi, other app calls location, etc). It won't be on a consistent basis. If all you care about is the user logging in, I would possibly do away with the significant monitoring all together. If you still need location, then be prepared to only get sporadic updates on the location.

like image 182
Bill Burgess Avatar answered Nov 01 '22 21:11

Bill Burgess