Beispiel #1
0
        public async Task <IActionResult> Subscription(string endpoint)
        {
            //if(string.IsNullOrEmpty(endpoint))
            //{
            //    endpoint = Request.Query["endpoint"];
            //}

            await _subscriptionStore.DeleteSubscription(endpoint);

            return(NoContent());
        }
        private async Task HandlePushMessageDeliveryExceptionAsync(Exception exception, PushSubscription subscription)
        {
            PushServiceClientException pushServiceClientException = exception as PushServiceClientException;

            if (pushServiceClientException is null)
            {
                _logger?.LogError(exception, "Failed requesting push message delivery to {0}.", subscription.Endpoint);
            }
            else
            {
                if ((pushServiceClientException.StatusCode == HttpStatusCode.NotFound) || (pushServiceClientException.StatusCode == HttpStatusCode.Gone))
                {
                    await _pushSubscriptionStore.DeleteSubscription(subscription.Endpoint);

                    _logger?.LogInformation("Subscription has expired or is no longer valid and has been removed.");
                }
            }
        }