Commit 1989fd4f by Sebastián Katzer

Small WP8 changes

parent 29271edb
...@@ -46,7 +46,7 @@ namespace Cordova.Extension.Commands ...@@ -46,7 +46,7 @@ namespace Cordova.Extension.Commands
/// <summary> /// <summary>
/// Informs either the app is running in background or foreground /// Informs either the app is running in background or foreground
/// </summary> /// </summary>
private bool RunsInBackground = true; private bool RunsInBackground = false;
/// <summary> /// <summary>
/// Sets application live tile /// Sets application live tile
...@@ -141,22 +141,6 @@ namespace Cordova.Extension.Commands ...@@ -141,22 +141,6 @@ namespace Cordova.Extension.Commands
} }
/// <summary> /// <summary>
/// Called when the application has been switched to background
/// </summary>
public void pause (string jsonArgs)
{
RunsInBackground = true;
}
/// <summary>
/// Called when the application has been switched to foreground
/// </summary>
public void resume (string jsonArgs)
{
RunsInBackground = false;
}
/// <summary>
/// Creates tile data /// Creates tile data
/// </summary> /// </summary>
private FlipTileData CreateTileData (Options options) private FlipTileData CreateTileData (Options options)
...@@ -215,5 +199,22 @@ namespace Cordova.Extension.Commands ...@@ -215,5 +199,22 @@ namespace Cordova.Extension.Commands
{ {
return RunsInBackground ? "background" : "foreground"; return RunsInBackground ? "background" : "foreground";
} }
/// <summary>
/// Occurs when the application is being deactivated.
/// </summary>
public override void OnPause (object sender, DeactivatedEventArgs e)
{
RunsInBackground = true;
}
/// <summary>
/// Occurs when the application is being made active after previously being put
/// into a dormant state or tombstoned.
/// </summary>
public override void OnResume (object sender, Microsoft.Phone.Shell.ActivatedEventArgs e)
{
RunsInBackground = false;
}
} }
} }
...@@ -214,7 +214,7 @@ channel.deviceready.subscribe( function () { ...@@ -214,7 +214,7 @@ channel.deviceready.subscribe( function () {
channel.onCordovaReady.subscribe( function () { channel.onCordovaReady.subscribe( function () {
channel.onCordovaInfoReady.subscribe( function () { channel.onCordovaInfoReady.subscribe( function () {
if (device.platform != 'iOS') { if (device.platform == 'Android') {
channel.onPause.subscribe( function () { channel.onPause.subscribe( function () {
cordova.exec(null, null, 'LocalNotification', 'pause', []); cordova.exec(null, null, 'LocalNotification', 'pause', []);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment