title: How to implement FCM in ASP.Net C#?
body: <p>I am using GCM for notifications on Android with c#, but now I want to change GCM to FCM.</p>
  
  <p>What do I have to change for that? Or how can I implement FCM in C#? Any help is appreciated. I am currently using this code for FCM, I just changed URL but it's not working.</p>
  
  <pre><code>         try { 
              msg = message;
  
              var applicationID = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
              var SENDER_ID = "xxxxxxxxxxx";
  
              WebRequest tRequest;
              //tRequest = WebRequest.Create("https://android.googleapis.com/gcm/send");
              tRequest = WebRequest.Create("https://fcm.googleapis.com/fcm/send");
              tRequest.Method = "post";
  
              tRequest.ContentType = "application/x-www-form-urlencoded";
              tRequest.Headers.Add(string.Format("Authorization: key={0}", applicationID));
  
              tRequest.Headers.Add(string.Format("Sender: id={0}", SENDER_ID));
  
              string postData = "collapse_key=score_update&amp;time_to_live=108&amp;delay_while_idle=1&amp;data.message=" + message + "&amp;data.time=" + System.DateTime.Now.ToString() +                               "&amp;registration_id=" + notificationtoken + "";
  
              Byte[] byteArray = Encoding.UTF8.GetBytes(postData);
              tRequest.ContentLength = byteArray.Length;
  
              Stream dataStream = tRequest.GetRequestStream();
              dataStream.Write(byteArray, 0, byteArray.Length);
              dataStream.Close();
  
              WebResponse tResponse = tRequest.GetResponse();
  
              dataStream = tResponse.GetResponseStream();
  
              StreamReader tReader = new StreamReader(dataStream);
  
              String sResponseFromServer = tReader.ReadToEnd();
  
              notification = sResponseFromServer;
              tReader.Close();
              dataStream.Close();
              tResponse.Close();
         return sResponseFromServer;
                       }
          catch (Exception ex)
          {
              notification.Status = false;
              notification = "ERROR DESCRIPTION : " + ex.Message;
          }
  </code></pre>