News

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.