Exemple #1
0
 private async Task HandleFailures(string userId, PushFailedException ex)
 {
     foreach (var failed in ex.Failures)
     {
         logger.LogError($"Push to {failed.Configuration.Id} failed.", failed.Exception);
         var response = (failed.Exception as PushException)?.ResponseMessage;
         if (HttpStatusCode.Gone == response?.StatusCode)
         {
             await pushConfigurationManager.DeleteAsync(userId, failed.Configuration.Id);
         }
     }
 }
Exemple #2
0
        public async Task <IActionResult> Delete(string configurationId)
        {
            var success = await pushConfigurationManager.DeleteAsync(User.GetId(), configurationId);

            if (success)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }