public static void SendPushNotificationsAndroid(string body, string title, List<string> userTokens, int badge, int NotificationTypeID, string SenderId, string ReceiverId)
{
try
{
WebClient wc = new WebClient();
wc.Headers.Add(HttpRequestHeader.Authorization, "key=BMw_8jzwtx29ZKnBDb5K6bTICS-8Mk7ID_Qx0xXeGUFi72UW3R-qhbiOG8rezlvrq4_5u4jB3Swi80DXPryE4-Y");
wc.Headers.Add("sender", "id=106275667816");
wc.Headers.Add(HttpRequestHeader.ContentType, "application/json");
wc.Encoding = Encoding.UTF8;
List<string> response = new List<string>();
NotificationModel notificationModel = new NotificationModel();
notificationModel.registration_ids = userTokens;
notificationModel.data = new Models.Notification.data() { title = title, body = body, badge = badge.ToString(), NotifcationTypeid = NotificationTypeID, SenderID = SenderId, ReceiverID = ReceiverId, sound = "default", sound2 = "default", click_action = "FLUTTER_NOTIFICATION_CLICK" };
notificationModel.notification = new Models.Notification.notification() { body = body, title = title, sound = "default", sound2 = "default", click_action = "FLUTTER_NOTIFICATION_CLICK" };
string result = wc.UploadString("https://fcm.googleapis.com/fcm/send", "POST", JsonConvert.SerializeObject(notificationModel));
response.Add(result);
}
catch (Exception ex)
{
}