Created
November 14, 2017 14:14
-
-
Save sthewissen/ad53bf8a302ab4ace6eef91e5299b51e to your computer and use it in GitHub Desktop.
Revisions
-
sthewissen revised this gist
Nov 14, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,6 @@ public interface INotificationManager public class NotificationManager : INotificationManager { public async Task<bool> SendNotification(string message) { try -
sthewissen created this gist
Nov 14, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ public interface INotificationManager { Task<bool> SendNotification(string message); } public class NotificationManager : INotificationManager { public async Task<bool> SendNotification(string message) { try { var hub = NotificationHubClient.CreateClientFromConnectionString(Constants.NotificationAccessKey, Constants.NotificationHubName); // Send the notification var result = await hub.SendAppleNativeNotificationAsync("{\"aps\":{\"alert\":\"" + message + "\", \"title\":\"" + message + "\", \"sound\":\"bingbong.aiff\"}}"); return true; } catch (Exception) { return false; } } }