Loading src/wp8/LocalNotification.cs +26 −6 Changes for src/wp8/LocalNotification.cs: 26 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ namespace Cordova.Extension.Commands { // Set the properties to update for the Application Tile // Empty strings for the text values and URIs will result in the property being cleared. StandardTileData TileData = CreateTileData(options); FlipTileData TileData = CreateTileData(options); // Update the Application Tile AppTile.Update(TileData); Loading Loading @@ -76,10 +76,14 @@ namespace Cordova.Extension.Commands { // Set the properties to update for the Application Tile // Empty strings for the text values and URIs will result in the property being cleared. StandardTileData TileData = new StandardTileData FlipTileData TileData = new FlipTileData { BackTitle = "", BackContent = "" BackContent = "", WideBackContent = "", SmallBackgroundImage = new Uri("appdata:Background.png"), BackgroundImage = new Uri("appdata:Background.png"), WideBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileLarge.png", UriKind.Relative), }; // Update the Application Tile Loading @@ -92,9 +96,9 @@ namespace Cordova.Extension.Commands /// <summary> /// Creates tile data /// </summary> private StandardTileData CreateTileData (LocalNotificationOptions options) private FlipTileData CreateTileData(LocalNotificationOptions options) { StandardTileData tile = new StandardTileData(); FlipTileData tile = new FlipTileData(); // Badge sollte nur gelöscht werden, wenn expliziet eine `0` angegeben wurde if (options.Badge != 0) Loading @@ -103,7 +107,23 @@ namespace Cordova.Extension.Commands } tile.BackTitle = options.Title; tile.BackContent = options.Message; tile.BackContent = options.ShortMessage; tile.WideBackContent = options.Message; if (!String.IsNullOrEmpty(options.SmallImage)) { tile.SmallBackgroundImage = new Uri(options.SmallImage, UriKind.RelativeOrAbsolute); } if (!String.IsNullOrEmpty(options.Image)) { tile.BackgroundImage = new Uri(options.Image, UriKind.RelativeOrAbsolute); } if (!String.IsNullOrEmpty(options.WideImage)) { tile.WideBackgroundImage = new Uri(options.WideImage, UriKind.RelativeOrAbsolute); } return tile; } Loading src/wp8/LocalNotificationOptions.cs +33 −0 Changes for src/wp8/LocalNotificationOptions.cs: 33 added lines, 0 removed lines. Original line number Diff line number Diff line using System; using System.Linq; using System.Runtime.Serialization; namespace De.APPPlant.Cordova.Plugin.LocalNotification Loading @@ -20,6 +22,19 @@ namespace De.APPPlant.Cordova.Plugin.LocalNotification [DataMember(IsRequired = false, Name = "message")] public string Message { get; set; } /// <summary> /// Gekürzte Nachricht (alles ab dem Zeilenumbruch entfernt) /// </summary> public string ShortMessage { get { string[] separator = new string[] { "\r\n", "\n" }; return Message.Split(separator, StringSplitOptions.RemoveEmptyEntries).First(); } } /// <summary> /// Displays number badge to notification /// </summary> Loading Loading @@ -55,5 +70,23 @@ namespace De.APPPlant.Cordova.Plugin.LocalNotification /// </summary> [DataMember(IsRequired = false, Name = "foreground")] public string Foreground { get; set; } /// <summary> /// The notification small background image to be displayed /// </summary> [DataMember(IsRequired = false, Name = "smallImage")] public string SmallImage { get; set; } /// <summary> /// The notification background image to be displayed /// </summary> [DataMember(IsRequired = false, Name = "image")] public string Image { get; set; } /// <summary> /// The notification wide background image to be displayed /// </summary> [DataMember(IsRequired = false, Name = "wideImage")] public string WideImage { get; set; } } } Loading
src/wp8/LocalNotification.cs +26 −6 Changes for src/wp8/LocalNotification.cs: 26 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ namespace Cordova.Extension.Commands { // Set the properties to update for the Application Tile // Empty strings for the text values and URIs will result in the property being cleared. StandardTileData TileData = CreateTileData(options); FlipTileData TileData = CreateTileData(options); // Update the Application Tile AppTile.Update(TileData); Loading Loading @@ -76,10 +76,14 @@ namespace Cordova.Extension.Commands { // Set the properties to update for the Application Tile // Empty strings for the text values and URIs will result in the property being cleared. StandardTileData TileData = new StandardTileData FlipTileData TileData = new FlipTileData { BackTitle = "", BackContent = "" BackContent = "", WideBackContent = "", SmallBackgroundImage = new Uri("appdata:Background.png"), BackgroundImage = new Uri("appdata:Background.png"), WideBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileLarge.png", UriKind.Relative), }; // Update the Application Tile Loading @@ -92,9 +96,9 @@ namespace Cordova.Extension.Commands /// <summary> /// Creates tile data /// </summary> private StandardTileData CreateTileData (LocalNotificationOptions options) private FlipTileData CreateTileData(LocalNotificationOptions options) { StandardTileData tile = new StandardTileData(); FlipTileData tile = new FlipTileData(); // Badge sollte nur gelöscht werden, wenn expliziet eine `0` angegeben wurde if (options.Badge != 0) Loading @@ -103,7 +107,23 @@ namespace Cordova.Extension.Commands } tile.BackTitle = options.Title; tile.BackContent = options.Message; tile.BackContent = options.ShortMessage; tile.WideBackContent = options.Message; if (!String.IsNullOrEmpty(options.SmallImage)) { tile.SmallBackgroundImage = new Uri(options.SmallImage, UriKind.RelativeOrAbsolute); } if (!String.IsNullOrEmpty(options.Image)) { tile.BackgroundImage = new Uri(options.Image, UriKind.RelativeOrAbsolute); } if (!String.IsNullOrEmpty(options.WideImage)) { tile.WideBackgroundImage = new Uri(options.WideImage, UriKind.RelativeOrAbsolute); } return tile; } Loading
src/wp8/LocalNotificationOptions.cs +33 −0 Changes for src/wp8/LocalNotificationOptions.cs: 33 added lines, 0 removed lines. Original line number Diff line number Diff line using System; using System.Linq; using System.Runtime.Serialization; namespace De.APPPlant.Cordova.Plugin.LocalNotification Loading @@ -20,6 +22,19 @@ namespace De.APPPlant.Cordova.Plugin.LocalNotification [DataMember(IsRequired = false, Name = "message")] public string Message { get; set; } /// <summary> /// Gekürzte Nachricht (alles ab dem Zeilenumbruch entfernt) /// </summary> public string ShortMessage { get { string[] separator = new string[] { "\r\n", "\n" }; return Message.Split(separator, StringSplitOptions.RemoveEmptyEntries).First(); } } /// <summary> /// Displays number badge to notification /// </summary> Loading Loading @@ -55,5 +70,23 @@ namespace De.APPPlant.Cordova.Plugin.LocalNotification /// </summary> [DataMember(IsRequired = false, Name = "foreground")] public string Foreground { get; set; } /// <summary> /// The notification small background image to be displayed /// </summary> [DataMember(IsRequired = false, Name = "smallImage")] public string SmallImage { get; set; } /// <summary> /// The notification background image to be displayed /// </summary> [DataMember(IsRequired = false, Name = "image")] public string Image { get; set; } /// <summary> /// The notification wide background image to be displayed /// </summary> [DataMember(IsRequired = false, Name = "wideImage")] public string WideImage { get; set; } } }