public static string SendMessage()
"AAAAcAxADlY:APA91bG-5WWWwbwcekNvZ6JV1AkDOdrBpOfT3D9BsIghLg-0cJW-7edevrvbUvCNbRk1Q_Mkfotm9xaYhWeXS_A7m2EPjdJvJ-ychBDJoSEEtr0j_l8ck0UznyMr5Brqlc60WZgchuut";
var webAddr = "https://fcm.googleapis.com/fcm/send";
"enQha9MmBoE:APA91bG--WqpY6YOkMwc696j4X5eMWJ8im6o_IeQTikyeF496iS1FNR8yGFyoORcxSXmogLnwPx2rccxI0rydncHTahOjlS13iu9I_Gahv2PFLVLgEHq6Qi9GzEQUlQ_oS6eP_9GX9R3";
var httpWebRequest = (HttpWebRequest) WebRequest.Create(webAddr);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Headers.Add("Authorization:key=" + serverKey);
httpWebRequest.Method = "POST";
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
string json = "{\"to\": \"" + regID +
"\",\"notification\": {\"title\": \"New deal\",\"body\": \"20% deal!\"},\"priority\":10}";
streamWriter.Write(json);
var httpResponse = (HttpWebResponse) httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
result = streamReader.ReadToEnd();
Console.WriteLine(ex.ToString());
public static void Main()