chore(backgroundGeolocation): update usage

This commit is contained in:
Max Lynch 2016-08-01 16:44:51 -05:00
parent 4e206812f0
commit 09e6fc9738

View File

@ -180,18 +180,19 @@ export interface Config {
* stopOnTerminate: false, // enable this to clear background location settings when the app terminates
* };
*
* BackgroundGeolocation.configure(config)
* .then((location) => {
* console.log('[js] BackgroundGeolocation callback: ' + location.latitude + ',' + location.longitude);
*
* // IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
* // and the background-task may be completed. You must do this regardless if your HTTP request is successful or not.
* // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
* BackgroundGeolocation.finish(); // FOR IOS ONLY
* })
* .catch((error) => {
* console.log('BackgroundGeolocation error');
* });
* BackgroundGeolocation.configure((location) => {
console.log('[js] BackgroundGeolocation callback: ' + location.latitude + ',' + location.longitude);
// IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
// and the background-task may be completed. You must do this regardless if your HTTP request is successful or not.
// IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
BackgroundGeolocation.finish(); // FOR IOS ONLY
* }, (error) => {
* console.log('BackgroundGeolocation error');
* }, {
* //options
* });
*
* // Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app.
* BackgroundGeolocation.start();