From 04798c7354e0b5169e249c436e50216322e5191a Mon Sep 17 00:00:00 2001 From: arnauddrain Date: Mon, 11 Feb 2019 14:10:53 +0100 Subject: [PATCH 1/2] docs(background-geolocation): update usage doc --- .../plugins/background-geolocation/index.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/@ionic-native/plugins/background-geolocation/index.ts b/src/@ionic-native/plugins/background-geolocation/index.ts index 9e772b8bb..cac028930 100644 --- a/src/@ionic-native/plugins/background-geolocation/index.ts +++ b/src/@ionic-native/plugins/background-geolocation/index.ts @@ -514,15 +514,17 @@ export declare enum BackgroundGeolocationIOSActivity { * }; * * this.backgroundGeolocation.configure(config) - * .subscribe((location: BackgroundGeolocationResponse) => { + * .then(() => { * - * console.log(location); - * - * // 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. - * this.backgroundGeolocation.finish(); // FOR IOS ONLY + * this.backgroundGeolocation.on('location').subscribe((location: BackgroundGeolocationResponse) => { + * console.log(location); * + * // 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 operations are successful or not. + * // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background. + * this.backgroundGeolocation.finish(); // FOR IOS ONLY + * }); + * * }); * * // start recording location @@ -549,7 +551,7 @@ export class BackgroundGeolocation extends IonicNativePlugin { * Configure the plugin. * * @param options {BackgroundGeolocationConfig} options An object of type Config - * @return {Observable} + * @return {Promise} */ @Cordova() configure(options: BackgroundGeolocationConfig): Promise { From e9911aa4ad2fd1673ff0ed6e64df2d341bb5afbc Mon Sep 17 00:00:00 2001 From: arnauddrain Date: Mon, 11 Feb 2019 14:20:56 +0100 Subject: [PATCH 2/2] style(background-geolocation): remove trailing whitespace --- src/@ionic-native/plugins/background-geolocation/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/background-geolocation/index.ts b/src/@ionic-native/plugins/background-geolocation/index.ts index cac028930..9cf2c4d51 100644 --- a/src/@ionic-native/plugins/background-geolocation/index.ts +++ b/src/@ionic-native/plugins/background-geolocation/index.ts @@ -524,7 +524,7 @@ export declare enum BackgroundGeolocationIOSActivity { * // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background. * this.backgroundGeolocation.finish(); // FOR IOS ONLY * }); - * + * * }); * * // start recording location