From ba5ddf32cab4830d7e4f869a8c367a07e11652d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Sun, 23 Nov 2014 13:03:51 +0100 Subject: [PATCH] Update README.md --- README.md | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 26eb1f6..bbb6ad5 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ To prevent the app from being paused while in background, the `backroundMode.ena - To activate the background mode the app needs to be in foreground. ```javascript -window.plugin.backgroundMode.enable(); +cordova.plugins.backgroundMode.enable(); ``` ### Pause the app while in background @@ -108,7 +108,7 @@ The background mode can be disabled through the `backgroundMode.disable` interfa - Once the background mode has been disabled, the app will be paused when in background. ```javascript -window.plugin.backgroundMode.disable(); +cordova.plugins.backgroundMode.disable(); ``` @@ -150,38 +150,6 @@ cordova.plugins.backgroundMode.configure({ ``` -### WP8 Optimization -By default the plugin will track for geo updates while the application is in background and foreground. To stop tracking in foreground, the `MainPage.xaml.cs` file needs the following 2 methods: - -```c# -// MainPage.xaml.cs - -namespace your.own.namespace -{ - public partial class MainPage : PhoneApplicationPage - { - /// - /// The page (the app) will enter the background and the background mode - /// needs to be activated. - /// - protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) - { - Cordova.Extension.Commands.BackgroundMode.Activate(); - } - - /// - /// The page (the app) will enter the foreground and the background mode - /// needs to be deactivated. - /// - protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) - { - Cordova.Extension.Commands.BackgroundMode.Deactivate(); - } - } -} -``` - - ## Quirks ### iOS Crash