Exemplo n.º 1
0
        public async Task <IActionResult> Seen(string id, [FromQuery] string?channel = null, [FromQuery] string?deviceIdentifier = null)
        {
            var tokens = Enumerable.Repeat(TrackingToken.Parse(id, channel, deviceIdentifier), 1);

            await userNotificationService.TrackSeenAsync(tokens);

            return(TrackingPixel());
        }
Exemplo n.º 2
0
        public async Task Confirm([FromBody] TrackNotificationDto request)
        {
            if (request.Confirmed.HasValue)
            {
                await userNotificationService.TrackConfirmedAsync(request.Confirmed.Value, request.Channel);
            }

            if (request.Seen?.Length > 0)
            {
                await userNotificationService.TrackSeenAsync(request.Seen, request.Channel);
            }
        }
Exemplo n.º 3
0
        public async Task <IActionResult> ConfirmMe([FromBody] TrackNotificationDto request)
        {
            if (request.Confirmed != null)
            {
                var token = TrackingToken.Parse(request.Confirmed, request.Channel, request.DeviceIdentifier);

                await userNotificationService.TrackConfirmedAsync(token);
            }

            if (request.Seen?.Length > 0)
            {
                var tokens = request.Seen.Select(x => TrackingToken.Parse(x, request.Channel, request.DeviceIdentifier));

                await userNotificationService.TrackSeenAsync(tokens);
            }

            return(NoContent());
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Seen(Guid id, [FromQuery] string?channel = null)
        {
            await userNotificationService.TrackSeenAsync(Enumerable.Repeat(id, 1), channel);

            return(TrackingPixel());
        }