async void SendNotification() { try { HttpResponseMessage response = await NotificationRequest.GetNotPulledNotifications(); if (response.IsSuccessStatusCode) { string response_content = await response.Content.ReadAsStringAsync(); List <AppUserNotification> user_notifications = JsonConvert.DeserializeObject <List <AppUserNotification> >(response_content); if (user_notifications.Any()) { foreach (AppUserNotification user_notification in user_notifications) { HttpResponseMessage responseOb = await ObservationRequest.GetObservationById(user_notification.Observation); if (responseOb.IsSuccessStatusCode) { string response_contentOb = await responseOb.Content.ReadAsStringAsync(); RequestObservation observation = JsonConvert.DeserializeObject <RequestObservation>(response_contentOb); string title = "🚨 Good news! 🚨"; string message = "💰 Your observed product: " + observation.Product.Title + " is now available for: €" + user_notification.Notified_price + " 💰"; notificationManager.SendNotification(title, message); } else { if (responseOb.StatusCode == System.Net.HttpStatusCode.BadGateway) { await DisplayAlert("Try Again!", "No connection with the server", "OK"); } if (responseOb.StatusCode == System.Net.HttpStatusCode.BadRequest) { await DisplayAlert("Try Again!", "Invalid request", "OK"); } } } } } else { if (response.StatusCode == System.Net.HttpStatusCode.BadGateway) { await DisplayAlert("Try Again!", "No connection with the server", "OK"); } if (response.StatusCode == System.Net.HttpStatusCode.BadRequest) { await DisplayAlert("Try Again!", "Invalid request", "OK"); } } } catch (Exception ex) { Console.WriteLine("No notification"); } }