jamesmontemagno / Xamarin.Plugins

Cross-platform Native API Access from Shared Code!
MIT License
1.3k stars 380 forks source link

Significant location updates don't always stop after StopListeningAsync (iOS) #284

Closed kgerken closed 8 years ago

kgerken commented 8 years ago

This is a

Which plugin does this impact:

StopListeningAsync does not always stop the location monitoring if the geolocator was started with significant location changes (SLC). SLC wakes the app periodically and even restarts it after a device reboot. In those cases, IsListening in GeolocatorImplementation might no longer be true, so StopListeningAsync immediately returns.

CLLocationManager does not seem to provide a property to check for the current listening status, yet it appears to be save to call stopMonitoringSignificantLocationChanges on CLLocationManager even when the manager is not currently monitoring. But even if the check for IsListening was removed from StopListeningAsync, we would still need to know whether we should stop the "normal" location updates or SLC, so maybe the ListenerSettings need to be passed into StopListeningAsync as well?

jamesmontemagno commented 8 years ago

This issue was moved to jamesmontemagno/GeolocatorPlugin#5