Note that there are some explanatory texts on larger screens.

plurals
  1. POGCM push notification Server side for asp.net
    primarykey
    data
    text
    <p>I am new to .net and using .net as a server side for GCM push notification. I am using the below code and it working fine for single user(for below regId).My question is how to save all reg-id's in our .net server? I don't know whether it save in our server or not.If not saving the registered-id's then how to send push notifications to all registered users?</p> <pre><code> protected void Button1_Click(object sender, EventArgs e) { string regId = "APA91bFUgrdgtdgfdgxxxxxxxxxxxxxxxxxxxxxxxxxx6t1QDCn-4IiIAtvBhEt328QeYeLKoDeDFOgumrgACdydLCLvM0wM59nAzm_fZse3ta_A"; //server api key var applicationID = "AIzaSDGjvbnviiuteuoidsgdfsdryiIfgA"; var SENDER_ID = "77xxxxxx25"; var value = Label1.Text; //message box label 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 = "{ 'registration_id': [ '" + regId + "' ], 'data': {'message': '" + txtMsg.Text + "'}}"; 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=" + 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(); Label3.Text = sResponseFromServer; tReader.Close(); dataStream.Close(); tResponse.Close(); } </code></pre> <p>Now i am getting push notifications in my android device like <a href="http://img201.imageshack.us/img201/5599/gcmavdfirstmsg.png" rel="nofollow">this</a> and how to send or get text messages like "hii","test"... rather than "you got tickle".please help me..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload