Here's a nice little presentation by Harry Tormey at React Chicago which clearly lays out the complexities involved with tracking a device's location in the background and why this needs to be done directly with Native APIs.
This is exactly what the Background Geolocation plugin does for you.
BackgroundGeolocation now supports infinite geofencing. Why is this important? Because the native platforms limit the number of geofences which can be simultaneously monitored. For iOS the limit is 20 while Android allows 100.
Previously, you had to manually manage which geofences to monitor based upon the current location, perhaps asking the server periodically which geofences were within range.
Now you can load any number of geofences into the plugin (tested with tens-of-thousands). The plugin will periodically perform a geospatial query upon the geofences in the database, activating those closest within a configurable geofenceProximityRadius.
Following is an animation of this feature performed in the iOS simulator, where a series of geofences have been loaded along the entire City Drive route.
With Infinite Geofencing, BackgroundGeolocation is the most advanced geofencing plugin available, more advanced than any dedicated geofencing plugin.
During June 12-27 2016, I took a vacation in Iceland, circumnavigating the entire island. This was a great opportunity to do a long-term field-test in a remote, mountainous and sparsely populated territory.
I used two phones: iPhone 6s @ 9.3.2 and Android Nexus 5 @ 6.0.1 running Cordova Background Geolocation 1.7.0.
The results were much better than expected, even while travelling up rugged mountain roads and remote gravel-roads.
iOS is far more strict when it comes to background operation than Android. For an app which uses our Background Geolocation plugin, as soon as the plugin enters stationary mode, iOS will immediately suspend your app. In stationary-mode, the Background Geolocation plugin has created a geofence around the current position and iOS will not interrogate this geofence until a "significant-change" event occurs. A significant-change event is generated when the device changes cell-towers. This typically takes several urban city blocks of movement but can take a kilometer (or more, it depends on the nature of the network environment).
However, great care should be taken to manage preventSuspend mode since it will have a big impact on battery usage, since your app is constantly running in the background. This mode isn't meant to be used by everyone -- it should only be used in special cases (preferably applications where the phone is probably plugged into power) where the user is aware that your app is trading battery-power for tracking-responsiveness.