public void SendApple( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "message/apple")] HttpRequest req, [NotificationHubs] IAsyncCollector <HubsMessage> output) { var message = new HubsMessage("Notification Hub test message", Platform.Apple); output.AddAsync(message); }
public void SendAppleNotification( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "notification/apple")] HttpRequest req, [NotificationHubs] IAsyncCollector <HubsMessage> output) { var payload = @"{""aps"":{""alert"":""Notification Hub test notification""}}"; var notification = new HubsMessage(new AppleNotification(payload)); output.AddAsync(notification); }
public void SendMany( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "messages/many")] HttpRequest req, [NotificationHubs] IAsyncCollector <HubsMessage> output) { var message1 = new HubsMessage("Notification Hub test message 1", Platform.Android); var message2 = new HubsMessage("Notification Hub test message 3", Platform.Apple); var payload = @"{""data"":{""message"":""Notification Hub test notification""}}"; var notification = new HubsMessage(new AppleNotification(payload)); output.AddAsync(message1); output.AddAsync(message2); output.AddAsync(notification); }
public void SendRest( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "messages/rest")] HttpRequest req, [NotificationHubs] IAsyncCollector <HubsMessage> output) { var payload = @"%Replace with a payload that is specific to a platform%"; var dictionary = new Dictionary <string, string>(); var notification1 = new HubsMessage(new AppleNotification(payload)); var notification2 = new HubsMessage(new AdmNotification(payload)); var notification3 = new HubsMessage(new FcmNotification(payload)); var notification4 = new HubsMessage(new WindowsNotification(payload)); var notification5 = new HubsMessage(new TemplateNotification(dictionary)); var notification6 = new HubsMessage(new BaiduNotification(payload)); output.AddAsync(notification1); output.AddAsync(notification2); output.AddAsync(notification3); output.AddAsync(notification4); output.AddAsync(notification5); output.AddAsync(notification6); }
public void SendOne( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "messages")] HttpRequest req, [NotificationHubs] out HubsMessage output) { output = new HubsMessage("Notification Hub test message", Platform.Android); }
public void SendConfigure( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "messages/configure")] HttpRequest req, [NotificationHubs(Connection = "DefaultFullSharedAccessSignature", HubsName = "HubsName")] out HubsMessage output) { output = new HubsMessage("Notification Hub test message", Platform.Android); }