Infinite Geofencing Posted on 4 Jan 15:27 , 0 comments

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.

New BackgroundGeolocation feature: #watchPosition Posted on 22 Sep 17:40 , 0 comments

BackgroundGeolocation now has its own native #watchPosition method!

#watchPosition will keep your app running in the background (even on iOS!), so be careful with it.

Tracking Iceland Posted on 29 Jun 09:01 , 0 comments

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.

See the results with browsable map here

Cordova Background Geolocation 

React Native Background Geolocation

Native Script Background Geolocation

Background Geolocation Scheduler Posted on 22 Apr 00:18 , 0 comments

I've added new Scheduler feature for Background Geolocation.  It's working pretty fine with Android & iOS so far.

The Scheduler is able to auto-start itself on boot and have similar #stopOnTerminate option as well as #forceReload to auto-start the foreground activity (where your Javascript lives).

Now on npm Posted on 9 Apr 21:22 , 0 comments

cordova-background-geolocation can now be installed from npm:

Today's field-testing Posted on 10 Mar 21:23 , 2 comments

Here's a field-test I performed with my "Android Family" today, showing the results of various configurations.

I use the plugin's #emailLog method to fetch the log files during the test.

iOS "prevent suspend" mode. Posted on 14 Feb 16:14 , 0 comments

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).

preventSuspend: true

When you configure the Background Geolocation plugin with preventSuspend: true, the plugin will prevent iOS from suspending your app (without using any hacks) and constantly monitor the accelerometer, allowing the Javascript in your app to run indefinitely. Since your app is constantly running in the background, the plugin is much more responsive with detecting "stationary" exit, typically requiring just a few meters of movement.

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.

New Geofence Feature Posted on 20 May 00:51 , 0 comments

Today I implemented the ability to add arbitrary Geofences with iOS.  I'll implement Android next. 

 In debug-mode, the sound "Fan Fare" will play when you enter a geofence.  "Fan Fare" sounds like this:

The Javascript API looks like this: 

In my sample app, I add a geofence like this:

Premium HTTP and Persistence Layers Posted on 14 May 17:08 , 0 comments

The Premium version now has native HTTP and SQLite persistence layers for both iOS and Android.  The plugin will persist each received location to SQLite providing the ability to sync the recorded locations to your server when a network connection is present.

The following new parameters now exist in support of these features:

@config {Boolean} #autoSync [true]
set to true to automatically POST each recorded geolocation to your configured #url.  When set to false, the Javascript API provides a #sync method allowing you to manually sync the recorded locations.


@config {Boolean} batchSync [false]

Set to true to combine all recorded locations into a single HTTP request.  When set to false, the plugin will initiate an HTTP POST for each recorded geolocation (REST-style).

In addition, two new Javascript methods:

#getLocations(successFn, failureFn)
bgGeo.getLocations(function(locations) {
   console.log('Locations: ', locations);
}, function(errorMsg) {
    console.warn('Failed to get locations: ', errorMsg);
#sync(successFn, failureFn)
bgGeo.sync(function(locations) {
   console.log('Locations: ', locations);
}, function(errorMsg) {
    console.warn('Failed to get sync: ', errorMsg);

Decoupling of Background Geolocation from Cordova Posted on 27 Mar 11:27 , 0 comments

I've got the premium background geolocation plugin decoupled from Cordova and working in a pure native iOS app, woohoo.  Now I'm working on React-Native integration.