Exemple #1
0
        public async Task HandleAsync(PushExternalApnsNotificationCommand message, CancellationToken cancellationToken)
        {
            List <ApnsExternalUserDeviceToken> tokens = await repository.Where <ApnsExternalUserDeviceToken>(
                x => message.UserIds.Contains(x.ExternalUserId) &&
                x.AppId == message.AppId)
                                                        .ToListAsync(repository.GetQueryableResolver <ApnsExternalUserDeviceToken>());

            if (tokens.Count == 0)
            {
                return;
            }

            apnsBrokerDispatcher.QueueNotifications(
                tokens.Select(
                    x => new WrappedApnsNotification(new ApnsNotification(x.DeviceToken, message.Payload), x.AppId)));
        }
Exemple #2
0
 public Task PushNotification(PushExternalApnsNotificationCommand parameters)
 {
     return(CommandBus.SendAsync(parameters));
 }