GCM servisinden gönderdiğim mesajlar 20 25 sn geç geliyor
Asp.net Generic handler kullanarak GCM 'ye mesaj gönderiyorum ama gönderdiğim mesajlar geç gidiyor, sebeb ne olabilir?
string regId = context.Request.QueryString["GCMRegID"];
string SendMessage = context.Request.QueryString["SendMessage"];
string UserName = context.Request.QueryString["UserName"];
string param = HttpUtility.UrlEncode(SendMessage, Encoding.UTF8);
var applicationID = "AIzaSyDyXXxx-xxxxxxxxx-xxxxxxxxxxxxxxxxxxx";
var SENDER_ID = "XXXXXXXXXXX";
WebRequest tRequest;
tRequest = WebRequest.Create("https://android.googleapis.com/gcm/send");
tRequest.Method = "post";
tRequest.ContentType = " application/x-www-form-urlencoded;charset=UTF-8";
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&time_to_live=108&delay_while_idle=1&data.message="
+ param + "&data.time=" + System.DateTime.Now.ToString() + "®istration_id=" +
regId + "";
Console.WriteLine(postData);
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();
context.Response.Write(sResponseFromServer);
tReader.Close();
dataStream.Close();
tResponse.Close();