Loading src/wp8/LocalNotification.cs +31 −1 Changes for src/wp8/LocalNotification.cs: 31 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -38,6 +38,11 @@ namespace Cordova.Extension.Commands /// </summary> public class LocalNotification : BaseCommand { /// <summary> /// Informs either the app is running in background or foreground /// </summary> private bool isInBackground = true; /// <summary> /// Sets application live tile /// </summary> Loading Loading @@ -122,6 +127,22 @@ namespace Cordova.Extension.Commands DispatchCommandResult(); } /// <summary> /// Called when the application has been switched to background /// </summary> public void pause (string jsonArgs) { isInBackground = true; } /// <summary> /// Called when the application has been switched to foreground /// </summary> public void resume (string jsonArgs) { isInBackground = false; } /// <summary> /// Creates tile data /// </summary> Loading Loading @@ -162,7 +183,7 @@ namespace Cordova.Extension.Commands /// </summary> private void FireEvent (string Event, string Id, string JSON = "") { string state = "foreground"; string state = ApplicationState(); string args = String.Format("\'{0}\',\'{1}\',\'{2}\'", Id, state, JSON); string js = String.Format("window.plugin.notification.local.on{0}({1})", Event, args); Loading @@ -172,5 +193,14 @@ namespace Cordova.Extension.Commands DispatchCommandResult(pluginResult); } /// <summary> /// Retrieves the application state /// Either "background" or "foreground" /// </summary> private String ApplicationState () { return isInBackground ? "background" : "foreground"; } } } Loading
src/wp8/LocalNotification.cs +31 −1 Changes for src/wp8/LocalNotification.cs: 31 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -38,6 +38,11 @@ namespace Cordova.Extension.Commands /// </summary> public class LocalNotification : BaseCommand { /// <summary> /// Informs either the app is running in background or foreground /// </summary> private bool isInBackground = true; /// <summary> /// Sets application live tile /// </summary> Loading Loading @@ -122,6 +127,22 @@ namespace Cordova.Extension.Commands DispatchCommandResult(); } /// <summary> /// Called when the application has been switched to background /// </summary> public void pause (string jsonArgs) { isInBackground = true; } /// <summary> /// Called when the application has been switched to foreground /// </summary> public void resume (string jsonArgs) { isInBackground = false; } /// <summary> /// Creates tile data /// </summary> Loading Loading @@ -162,7 +183,7 @@ namespace Cordova.Extension.Commands /// </summary> private void FireEvent (string Event, string Id, string JSON = "") { string state = "foreground"; string state = ApplicationState(); string args = String.Format("\'{0}\',\'{1}\',\'{2}\'", Id, state, JSON); string js = String.Format("window.plugin.notification.local.on{0}({1})", Event, args); Loading @@ -172,5 +193,14 @@ namespace Cordova.Extension.Commands DispatchCommandResult(pluginResult); } /// <summary> /// Retrieves the application state /// Either "background" or "foreground" /// </summary> private String ApplicationState () { return isInBackground ? "background" : "foreground"; } } }