public async Task <FCMSendResponse> SendNotificationAsync(NotificationPostData postData) { FCMSendResponse sendResponse; try { string content = JsonConvert.SerializeObject(new { registration_ids = postData.FcmTokens.ToArray(), priority = "high", data = postData.MessageData, notification = new { body = postData.MessageData.Message, title = postData.MessageData.Title, icon = postData.MessageData.Image, click_action = postData.MessageData.Link, sound = "default", content_available = true } }); var body = new StringContent(content, Encoding.UTF8, "application/json"); sendResponse = await ExecuteFcmPostAsync(body).ConfigureAwait(false); } catch (Exception) { sendResponse = new FCMSendResponse() { Success = 0 }; } return(sendResponse); }
public FCMSendResponse SendNotification(NotificationPostData postData) { throw new NotImplementedException(); }