/// <summary> /// Firebase Push Notification Send Method /// </summary> /// <param name="notificationObject">Firebase Api Push Notification Send Method request Model parameter</param> /// <returns> bool </returns> public async Task <bool> Send(FirebaseMessage notificationObject) { bool sent = false; if (ValidateService.ValidateRequest(notificationObject)) { string jsonMessage = JsonConvert.SerializeObject(notificationObject); var request = new HttpRequestMessage(HttpMethod.Post, FireBasePushNotificationsURL); request.Headers.TryAddWithoutValidation("Authorization", "key=" + EncryptionHelper.Decrypt(_encryptedServerKey, _passPhrase)); request.Content = new StringContent(jsonMessage, Encoding.UTF8, "application/json"); HttpResponseMessage result; using (var client = new HttpClient()) { result = await client.SendAsync(request); sent = result.IsSuccessStatusCode; } } return(sent); }