Commit d982599f authored by Chris Scott's avatar Chris Scott

Forgot to add onStationaryMethod to js file

parent 584d2815
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
- (void) finish:(CDVInvokedUrlCommand*)command; - (void) finish:(CDVInvokedUrlCommand*)command;
- (void) onPaceChange:(CDVInvokedUrlCommand*)command; - (void) onPaceChange:(CDVInvokedUrlCommand*)command;
- (void) setConfig:(CDVInvokedUrlCommand*)command; - (void) setConfig:(CDVInvokedUrlCommand*)command;
- (void) onStationary:(CDVInvokedUrlCommand*)command; - (void) addStationaryRegionListener:(CDVInvokedUrlCommand*)command;
- (void) getStationaryLocation:(CDVInvokedUrlCommand *)command; - (void) getStationaryLocation:(CDVInvokedUrlCommand *)command;
- (void) onSuspend:(NSNotification *)notification; - (void) onSuspend:(NSNotification *)notification;
- (void) onResume:(NSNotification *)notification; - (void) onResume:(NSNotification *)notification;
......
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
enabled = YES; enabled = YES;
UIApplicationState state = [[UIApplication sharedApplication] applicationState]; UIApplicationState state = [[UIApplication sharedApplication] applicationState];
NSLog(@"- CDVBackgroundGeoLocation start (background? %ld)", state); NSLog(@"- CDVBackgroundGeoLocation start (background? %d)", state);
[locationManager startMonitoringSignificantLocationChanges]; [locationManager startMonitoringSignificantLocationChanges];
if (state == UIApplicationStateBackground) { if (state == UIApplicationStateBackground) {
......
var exec = require("cordova/exec"); var exec = require("cordova/exec");
module.exports = { module.exports = {
/**
* @property {Object} stationaryRegion
*/
stationaryRegion: null,
/**
* @property {Object} config
*/
config: {},
configure: function(success, failure, config) { configure: function(success, failure, config) {
this.config = config || {};
var params = JSON.stringify(config.params || {}), var params = JSON.stringify(config.params || {}),
headers = JSON.stringify(config.headers || {}), headers = JSON.stringify(config.headers || {}),
url = config.url || 'BackgroundGeoLocation_url', url = config.url || 'BackgroundGeoLocation_url',
...@@ -55,20 +65,34 @@ module.exports = { ...@@ -55,20 +65,34 @@ module.exports = {
* @param {Integer} timeout * @param {Integer} timeout
*/ */
setConfig: function(success, failure, config) { setConfig: function(success, failure, config) {
this.config = config || {};
exec(success || function() {}, exec(success || function() {},
failure || function() {}, failure || function() {},
'BackgroundGeoLocation', 'BackgroundGeoLocation',
'setConfig', 'setConfig',
[config]); [config]);
}, },
/** /**
* Returns current stationaryLocation if available. null if not * Returns current stationaryLocation if available. null if not
*/ */
getStationaryLocation: function(success, failure) { getStationaryLocation: function(success, failure) {
exec(success || function() {}, exec(success || function() {},
failure || function() {}, failure || function() {},
'BackgroundGeoLocation', 'BackgroundGeoLocation',
'getStationaryLocation', '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