pmwisdom/cordova-background-geolocation-services

unregisterForLocationUpdates?

Closed this issue · 2 comments

i registerForLocationUpdates multiple times (from time to time). Is it necessary to have an unregisterForLocationUpdates?

Your most recent registerForLocationUpdates should overwrite all the past callbacks. You should only get a location update from one callback at a time. I didn't write in support for multiple listeners so thats the way it should act.

Although I haven't tested it out so there may be different behavior. Let me know if thats not what you observe

@pmwisdom got it. i wrap the background positioning logic in an Observable and just have no idea how to do the cleanups. currently I put backgroundLocationServices.stop() in the cleanup callback and it seems to behave correctly.