Exemplo n.º 1
0
        public async Task <string> SendAsync(string message, string receiver)
        {
            var notification = new AndroidReminderBuilder()
                               .WithNeuron(Guid.NewGuid(), message)
                               .WithGroups("demo-group", "work", "project-nudelsieb")
                               .Build();

            var outcome = await hub.SendFcmNativeNotificationAsync(notification, tagExpression : $"user:{receiver}");

            logger.LogInformation($"Notified clients, tracking ID: {outcome.TrackingId}");

            return(outcome.TrackingId);
        }
 public Task <NotificationOutcome> SendFcmNativeNotificationAsync(string jsonPayload, string tagExpression, CancellationToken cancellationToken = default)
 => DefaultNamespace == DefaultNamespace.Primary ?
 _primaryNotificationHubClient.SendFcmNativeNotificationAsync(jsonPayload, tagExpression, cancellationToken) :
 _backupNotificationHubClient.SendFcmNativeNotificationAsync(jsonPayload, tagExpression, cancellationToken);