From 09e6fc973869d62babd738ee18d27c235643983c Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 1 Aug 2016 16:44:51 -0500 Subject: [PATCH] chore(backgroundGeolocation): update usage --- src/plugins/background-geolocation.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/plugins/background-geolocation.ts b/src/plugins/background-geolocation.ts index 96525634..dc452efd 100644 --- a/src/plugins/background-geolocation.ts +++ b/src/plugins/background-geolocation.ts @@ -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();