public async Task <IActionResult> SendNotification([FromBody] PushMessageViewModel messageVM)
        {
            var message = new PushMessage(messageVM.Notification)
            {
                Topic   = messageVM.Topic,
                Urgency = messageVM.Urgency
            };

            _pushService.SendNotificationAsync(message);

            return(NoContent());
        }
Beispiel #2
0
        public async Task <IActionResult> SendNotification([FromBody] PushMessageViewModel messageVM)
        {
            var message = new PushMessage(messageVM.Notification)
            {
                Topic   = messageVM.Topic,
                Urgency = messageVM.Urgency
            };

            await _subscriptionStore.ForEachSubscriptionAsync((PushSubscription subscription) =>
            {
                _pushClient.RequestPushMessageDeliveryAsync(subscription, message);
            });

            return(NoContent());
        }