christocracy/cordova-plugin-background-geolocation — pull request #71 by markwpearce (2014-09-16 16:40:02+00:00)
Title: New Option: stopOnTerminate

There is currently a problem if you force-quit (e.g. in iOS, double-tap home, then swipe away the app) an app that the geo-fences are still active in the OS. I believe this is also the case in Android.
This results in the "GPS in Use" indictor in the status bar to be active, Even though there's no way for your app to actually deal with the GPS fixes you might receive.

I believe this is the same issue as mentioned here:
https://github.com/christocracy/cordova-plugin-background-geolocation/issues/20

This pull request basically adds a configuration option ("stopOnTerminate" - a boolean) and overrides CordovaPlugin's "onAppTerminate" (obj-c) or "onDestroy" (java) - which are called when the app is closed, to call the stop() method or clear any geofences that are active, if that option is true.

This pull request also fixes some incorrect indices in the configuration options.

I added the details to README.md

Sorry about all the whitespace line changes - my text editor clears trailing whitespace automatically.

NOTE: this only fixes iOS and Android - I didn't look at Windows Phone stuff.