diff --git a/src/plugins/background-geolocation.ts b/src/plugins/background-geolocation.ts index 8bf5e22e1..4ca63ed06 100644 --- a/src/plugins/background-geolocation.ts +++ b/src/plugins/background-geolocation.ts @@ -170,26 +170,26 @@ export interface Config { * platform.ready().then(() => { * * // BackgroundGeolocation is highly configurable. See platform specific configuration options - * 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(); - * }, - * (error) => { - * console.log('BackgroundGeolocation error'); - * }, - * { + * let config = { * desiredAccuracy: 10, * stationaryRadius: 20, * distanceFilter: 30, * debug: true, // enable this hear sounds for background-geolocation life-cycle. * 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'); + * }); * * // Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app. * BackgroundGeolocation.start();