title: Push Notification to Android using FCM (c#)
body: <p>I would like to send a Push Notification to Android Using FCM and implementation in C#.</p>
  
  <p>I have used the following code and it give me the id in Response which seems all ok.</p>
  
  <p>But i didnt received any notification in my device as the device id is correct and received notification if i send it through the FCM Console.</p>
  
  <p>Any Suggestion would help.</p>
  
  <p>Thanks</p>
  
  <pre><code> var value = "This is first message to Android";
              WebRequest tRequest = WebRequest.Create("https://fcm.googleapis.com/fcm/send");
              tRequest.Method = "post";
              tRequest.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";
              tRequest.Headers.Add(string.Format("Authorization: key={0}", "AAAAosN-NoU:APA91bHg6Iv8qj2giVvSRVVFze4L6Si0VTwctkNaRRqlI7qffKAMPHo4fd52SgZcB8Ring-mnPrkqjodTGrSru_bXKRQD9n4eVxhs8pTbkXac1gotCM77EixMUXTplXhceIm1o20BVXvkHO1HQZBti990ijebUW1fg"));
              tRequest.Headers.Add(string.Format("Sender: id={0}", "699064530565"));
  
              string postData = "collapse_key=score_update&amp;time_to_live=108&amp;delay_while_idle=1&amp;data.message=" + value + "&amp;data.time=" + System.DateTime.Now.ToString() + "&amp;registration_id=" + "APA91bFD6jRdsSzQ37_rB2x4C8wJzcDzgdjZuhf4hFgzCndeESCEnHrW3sRQcwetljExhlEUrpquhdTW2C24qjtb-PJuUUhpnev3Zn_DDH6aF7PStFRPYvWSQcfLFd14sueLmbhCvcqr" + "";
  
              Byte[] byteArray = Encoding.UTF8.GetBytes(postData);
              tRequest.ContentLength = byteArray.Length;
  
              using (Stream dataStream = tRequest.GetRequestStream())
              {
                  dataStream.Write(byteArray, 0, byteArray.Length);
  
                  using (WebResponse tResponse = tRequest.GetResponse())
                  {
                      using (Stream dataStreamResponse = tResponse.GetResponseStream())
                      {
                          using (StreamReader tReader = new StreamReader(dataStreamResponse))
                          {
                              string sResponseFromServer = tReader.ReadToEnd();
                          }
                      }
                  }
              }
  </code></pre>