Last active
October 11, 2016 05:39
-
-
Save christocracy/516809e81b479f7b0556eb1a9277bcbd to your computer and use it in GitHub Desktop.
Background Geolocation Scheduler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bgGeo.configure({ | |
startOnBoot: true, // Scheduler will start when device is rebooted. | |
schedule: [ | |
'2,4 6:00-19:00', // Mon,Wed: 6:00am-7:00pm | |
'3 11:00-14:00', // Tue: 11:00am-2:00pm | |
'6 6:00-7:00', // Fri: 6:00am-7:00am | |
'6 8:00-19:00', // Fri: 8:00am-7:00pm | |
'2-6 20:00-21:00' // Mon-Fri: 8:00pm-9:00pm | |
] | |
}, function() { | |
// Start the scheduler | |
bgGeo.startSchedule(function() { | |
console.info('- Scheduler stopped'); | |
}); | |
}); | |
// Listen to schedule events | |
bgGeo.on('schedule', function(state) { | |
console.log('- Schedule event, enabled:', state.enabled); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment