Commit d982599f authored by Chris Scott's avatar Chris Scott

Forgot to add onStationaryMethod to js file

parent 584d2815
......@@ -19,7 +19,7 @@
- (void) finish:(CDVInvokedUrlCommand*)command;
- (void) onPaceChange:(CDVInvokedUrlCommand*)command;
- (void) setConfig:(CDVInvokedUrlCommand*)command;
- (void) onStationary:(CDVInvokedUrlCommand*)command;
- (void) addStationaryRegionListener:(CDVInvokedUrlCommand*)command;
- (void) getStationaryLocation:(CDVInvokedUrlCommand *)command;
- (void) onSuspend:(NSNotification *)notification;
- (void) onResume:(NSNotification *)notification;
......
......@@ -235,7 +235,7 @@
enabled = YES;
UIApplicationState state = [[UIApplication sharedApplication] applicationState];
NSLog(@"- CDVBackgroundGeoLocation start (background? %ld)", state);
NSLog(@"- CDVBackgroundGeoLocation start (background? %d)", state);
[locationManager startMonitoringSignificantLocationChanges];
if (state == UIApplicationStateBackground) {
......
var exec = require("cordova/exec");
module.exports = {
/**
* @property {Object} stationaryRegion
*/
stationaryRegion: null,
/**
* @property {Object} config
*/
config: {},
configure: function(success, failure, config) {
this.config = config || {};
var params = JSON.stringify(config.params || {}),
headers = JSON.stringify(config.headers || {}),
url = config.url || 'BackgroundGeoLocation_url',
......@@ -55,20 +65,34 @@ module.exports = {
* @param {Integer} timeout
*/
setConfig: function(success, failure, config) {
this.config = config || {};
exec(success || function() {},
failure || function() {},
'BackgroundGeoLocation',
'setConfig',
[config]);
},
/**
/**
* Returns current stationaryLocation if available. null if not
*/
getStationaryLocation: function(success, failure) {
exec(success || function() {},
getStationaryLocation: function(success, failure) {
exec(success || function() {},
failure || function() {},
'BackgroundGeoLocation',
'getStationaryLocation',
[]);
}
},
onStationary: function(success, failure) {
var me = this;
success = success || function() {};
var callback = function(region) {
me.stationaryRegion = region;
success.apply(me, arguments);
};
exec(callback,
failure || function() {},
'BackgroundGeoLocation',
'addStationaryRegionListener',
[]);
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment