Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do startMonitoringSignificantLocationChanges and startUpdatingLocation effect one-another?

What happens if I call startUpdatingLocation while startMonitoringSignificantLocationChanges is running? Does significantLocationChange monitoring get stopped? If I then stopUpdatingLocation will significantLocationChange monitoring continue or restart?

I can find no documentation covering the interplay between these two ways of monitoring location.

like image 766
Undistraction Avatar asked Jun 26 '12 09:06

Undistraction


1 Answers

I don't think the accepted answer really answers the question asked. I did some tests and you can use both if you want and they will not cancel each other out.

Why would someone want to use both ? Because startMonitoringSignificantLocationChanges wakes up the app from being suspended or terminated without the need of any background modes. So if you run both you can get accurate foreground location updates and significant location change background location updates.

Of course, you can switch the method, when going into background but a) that wasn't the question b) it adds unneeded logic

Of course, there's a question if running both methods drains more battery, but my bet is that it doesn't.

like image 148
michal.ciurus Avatar answered Nov 10 '22 06:11

michal.ciurus