public async Task <bool> NotifyUser(string userId, string title, string body, string target, string image,
                                            NotificationOptions notificationType)
        {
            _logger.LogDebug($"Notifying user");
            var message = new NotifyUserMessage {
                UserId = userId,
                Title  = title,
                Body   = body,
                Target = target,
                Image  = image
            };
            await _bus.PubSub.PublishAsync(message).ContinueWith(task => {
                if (task.IsFaulted)
                {
                    _logger.LogError($"Unable to publish custom notification.\n{task.Exception}");
                }
            });

            return(true);
        }
Exemple #2
0
 public void Notify(NotifyUserMessage message)
 {
     _log.Info($"{message.GetType().Name} received: {message.Notification}");
 }