在VisualStudio2010中新建网站JPushAndroid。添加引用json帮助类库Newtonsoft.Json.dll。在web.config增加appkey和mastersecret,可以在极光官网www.jpush.cn申请。web.config源码:<?xml version="1.0"?><!--有关如何配置 ASP.NET 应用程序的详细信息,请访问http://go.microsoft.com/fwlink/?LinkId=169433--><configuration><appSettings><add key="AppKey" value="b232c57153afc71ed74ae3da"/><add key="MasterSecret" value="1ed5fcf68f44ea2a6b01e854"/></appSettings><system.web><compilation debug="true" targetFramework="4.0"/></system.web></configuration>添加类JPushV3,会弹出保存类在App_code文件夹下,确定。JpushV3代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Net;using System.Text;using System.IO;using System.Configuration;using System.Collections;/** 参考文档:http://docs.jpush.cn/display/dev/Index  选择里面的:服务器端 API,Push-API-V3** 极光推送的网站的网址是:https://www.jpush.cn/*   旧版本V2  http://docs.jpush.cn/display/dev/Push+API+v2* 最新版本V3  http://docs.jpush.cn/display/dev/Push-API-v3** 其中服务端的接口以及示例代码都在这里:http://docs.jpush.cn/display/dev/Server-SDKs*//// <summary>/// 极光推送的最新版:PUSH-API-V3/// 参考地址 http://docs.jpush.cn/display/dev/Push-API-v3/// POST https://api.jpush.cn/v3/push/// </summary>public class JPushV3{/// <summary>/// 应用标识:极光推送的用户名/// </summary>private readonly string AppKey = ConfigurationManager.AppSettings["AppKey"];/// <summary>/// 极光推送的密码/// </summary>private readonly string MasterSecret = ConfigurationManager.AppSettings["MasterSecret"];/// <summary>/// 极光推送请求的url地址/// </summary>private readonly string RequestUrl = "https://api.jpush.cn/v3/push";/// <summary>/// 查询推送结果请求的Url地址/// </summary>private readonly string ReceivedUrl = "https://report.jpush.cn/v3/received";/// <summary>/// 发送推送请求到JPush,使用HttpWebRequest/// </summary>/// <param name="method">传入POST或GET</param>/// <param name="url">固定地址</param>/// <param name="auth">用户名AppKey和密码MasterSecret形成的Base64字符串</param>/// <param name="reqParams">请求的json参数,一般由Platform(平台)、Audience(设备对象标识)、Notification(通知)、Message(自定义消息)、Options(推送可选项)组成</param>/// <returns></returns>public string SendRequest(String method, String url, String auth, String reqParams){string resultJson = "";HttpWebRequest myReq = null;HttpWebResponse response = null;try{myReq = (HttpWebRequest)WebRequest.Create(url);myReq.Method = method;myReq.ContentType = "application/json";if (!String.IsNullOrEmpty(auth)){myReq.Headers.Add("Authorization", "Basic " + auth);}if (method == "POST"){byte[] bs = UTF8Encoding.UTF8.GetBytes(reqParams);myReq.ContentLength = bs.Length;using (Stream reqStream = myReq.GetRequestStream()){reqStream.Write(bs, 0, bs.Length);reqStream.Close();}}response = (HttpWebResponse)myReq.GetResponse();HttpStatusCode statusCode = response.StatusCode;if (Equals(response.StatusCode, HttpStatusCode.OK)){using (StreamReader reader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.UTF8)){resultJson = reader.ReadToEnd();try{object json = Newtonsoft.Json.JsonConvert.DeserializeObject(resultJson);}catch{resultJson = string.Format("{{\"error\": {{\"message\": \"{0}\", \"code\": 10086}}}}", "响应的结果不是正确的json格式");}}              }}catch (WebException ex){if (ex.Status == WebExceptionStatus.ProtocolError){HttpStatusCode errorCode = ((HttpWebResponse)ex.Response).StatusCode;string statusDescription = ((HttpWebResponse)ex.Response).StatusDescription;using (StreamReader sr = new StreamReader(((HttpWebResponse)ex.Response).GetResponseStream(), System.Text.Encoding.UTF8)){resultJson = sr.ReadToEnd();//{"errcode":404,"errmsg":"request api doesn't exist"}
Dictionary<string, object> dict = JsonToDictionary(resultJson);string errCode = "10086";string errMsg = "发送推送的请求地址不存在或无法连接";if (dict.ContainsKey("errcode")){errCode = dict["errcode"].ToString();}if (dict.ContainsKey("errmsg")){errMsg = dict["errmsg"].ToString();}resultJson = string.Format("{{\"error\": {{\"message\": \"{0}\", \"code\": {1}}}}}", errMsg, errCode);}}else{//这里一定是error作为键名(自定义错误号10086),和极光推送失败时的json格式保持一致 如 {"error": {"message": "Missing parameter", "code": 1002}}
resultJson = string.Format("{{\"error\": {{\"message\": \"{0}\", \"code\": 10086}}}}", ex.Message.Replace("\"", " ").Replace("'", " "));}}catch (System.Exception ex){resultJson = string.Format("{{\"error\": {{\"message\": \"{0}\", \"code\": 10086}}}}", ex.Message.Replace("\"", " ").Replace("'", " "));}finally{if (response != null){response.Close();}if (myReq != null){myReq.Abort();}}return resultJson;}/// <summary>/// 通过用户名AppKey和密码获取验证码/// </summary>/// <returns></returns>private string GetBase64Auth(){string str = this.AppKey + ":" + this.MasterSecret;byte[] bytes = Encoding.Default.GetBytes(str);return Convert.ToBase64String(bytes);}/// <summary>/// 发送推送请求到JPush/// </summary>/// <param name="method">POST或GET</param>/// <param name="reqParams">请求的json参数,一般由Platform(平台)、Audience(设备对象标识)、Notification(通知)、Message(自定义消息)、Options(推送可选项)组成</param>/// <returns></returns>public string SendRequest(String method, String reqParams){string auth = GetBase64Auth();return SendRequest(method, this.RequestUrl, auth, reqParams);}/// <summary>/// 发送Post请求/// </summary>/// <param name="reqParams">请求的json参数,一般由Platform(平台)、Audience(设备对象标识)、Notification(通知)、Message(自定义消息)、Options(推送可选项)组成</param>/// <returns></returns>public string SendPostRequest(String reqParams){string auth = GetBase64Auth();return SendRequest("POST", this.RequestUrl, auth, reqParams);}/// <summary>/// 发送Get请求/// </summary>/// <param name="reqParams">请求的json参数,一般由Platform(平台)、Audience(设备对象标识)、Notification(通知)、Message(自定义消息)、Options(推送可选项)组成</param>/// <returns></returns>public string SendGetRequest(String reqParams){string auth = GetBase64Auth();return SendRequest("GET", this.RequestUrl, auth, reqParams);}/** 生成唯一的sendNo的方法: 取序列号* 查看返回结果的方法*//// <summary>/// 查询推送的结果/// </summary>/// <param name="msg_ids">生成的json信息唯一id</param>/// <returns></returns>public string GetReceivedResult(String msg_ids){string url = this.ReceivedUrl + "?msg_ids=" + msg_ids;String auth = GetBase64Auth();return SendRequest("GET", url, auth, null); ;}/** 1.正确时返回结果{"sendno":"123456","msg_id":"1799597405"}* 或者 {"sendno":"0","msg_id":"351403900"}* 2.入参json完全正确,但找不到要到达的设备。错误时:返回* {"msg_id": 3125719446, "error": {"message": "cannot find user by this audience", "code": 1011}}* 3.传入空字符串 或者 非json格式,或者没有必须的选项:{"error": {"message": "Missing parameter", "code": 1002}}* 传入的键(键区分大小写)、值不符合要求 {"error": {"message": "Audience value must be JSON Array format!", "code": 1003}} *//// <summary>/// 将返回的json转换为Hashtable对象/// </summary>/// <param name="jsonString"></param>/// <returns></returns>public Hashtable JsonToHashtable(string jsonString){/** 正确时返回结果{"sendno":"123456","msg_id":"1799597405"}* {"sendno":"0","msg_id":"351403900"}* 入参json完全正确,但找不到要到达的设备。错误时:返回 {"msg_id": 3125719446, "error": {"message": "cannot find user by this audience", "code": 1011}}* 传入空字符串 或者 非json格式,或者没有必须的选项:{"error": {"message": "Missing parameter", "code": 1002}}* 传入的键值不符合要求 {"error": {"message": "Audience value must be JSON Array format!", "code": 1003}}  键区分大小写*/Hashtable ht = new Hashtable();object json = Newtonsoft.Json.JsonConvert.DeserializeObject(jsonString);//返回的结果一定是一个json对象
Newtonsoft.Json.Linq.JObject jsonObject = json as Newtonsoft.Json.Linq.JObject;if (jsonObject == null){return ht;}foreach (Newtonsoft.Json.Linq.JProperty jProperty in jsonObject.Properties()){Newtonsoft.Json.Linq.JToken jToken = jProperty.Value;string value = "";if (jToken != null){value = jToken.ToString();}ht.Add(jProperty.Name, value);}return ht;}/// <summary>/// 根据json返回的结果判断是否推送成功/// </summary>/// <param name="jsonString">响应的json</param>/// <param name="errorMessage">错误信息</param>/// <param name="errorCode">错误号</param>/// <returns></returns>public bool IsSuccess(string jsonString, out string errorMessage, out string errorCode){Hashtable ht = JsonToHashtable(jsonString);errorMessage = "";errorCode = "";foreach (string key in ht.Keys){//如果存在error键,说明推送出错if (key == "error"){string errJson = ht[key].ToString();Hashtable htError = JsonToHashtable(errJson);errorMessage = htError["message"].ToString();errorCode = htError["code"].ToString();return false;}}return true;}/// <summary>/// 根据返回的响应json来判断推送是否成功,成功时记录sendno与msg_id。/// 失败时记录错误信息errorMessage、错误号errCode等/// </summary>/// <param name="jsonString">响应的json</param>/// <param name="errorMessage">错误信息</param>/// <param name="errorCode">错误号</param>/// <param name="sendno">用户自定义的推送编号(从序列号中获取),不设置则为0,成功后返回该编号</param>/// <param name="msg_id">极光服务器处理后返回的信息编号</param>/// <returns></returns>public bool IsSuccess(string jsonString, out string errorMessage, out string errorCode, out string sendno, out string msg_id){bool result = IsSuccess(jsonString, out errorMessage, out errorCode);Hashtable ht = JsonToHashtable(jsonString);sendno = "";msg_id = "";if (result) //推送成功时,只有键sendno、msg_id
{sendno = ht["sendno"].ToString();msg_id = ht["msg_id"].ToString();}else //如果失败时存在msg_id键,则记录msg_id的值
{if (ht.ContainsKey("msg_id")){msg_id = ht["msg_id"].ToString();}}return result;}/// <summary>/// 将返回的json转换为字典Dictionary对象/// </summary>/// <param name="jsonString"></param>/// <returns></returns>public Dictionary<string, object> JsonToDictionary(string jsonString){Dictionary<string, object> ht = new Dictionary<string, object>();object json = Newtonsoft.Json.JsonConvert.DeserializeObject(jsonString);//返回的结果一定是一个json对象
Newtonsoft.Json.Linq.JObject jsonObject = json as Newtonsoft.Json.Linq.JObject;if (jsonObject == null){return ht;}foreach (Newtonsoft.Json.Linq.JProperty jProperty in jsonObject.Properties()){Newtonsoft.Json.Linq.JToken jToken = jProperty.Value;string value = "";if (jToken != null){value = jToken.ToString();}ht.Add(jProperty.Name, value);}return ht;}}☆JPushV2类代码using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Configuration;using System.Text;using System.Net;using System.IO;using System.Security.Cryptography;/** 参考文档:http://docs.jpush.cn/display/dev/Index  选择里面的:服务器端 API,Push-API-V3** 极光推送的网站的网址是:https://www.jpush.cn/*   旧版本V2  http://docs.jpush.cn/display/dev/Push+API+v2* 最新版本V3  http://docs.jpush.cn/display/dev/Push-API-v3** 其中服务端的接口以及示例代码都在这里:http://docs.jpush.cn/display/dev/Server-SDKs*//// <summary>/// 这个版本是Push-API-v2版本,只能用到2015-12-31,建议直接使用最新版v3/// post处理地址 http://api.jpush.cn:8800/v2/push/// </summary>public class JPushV2{/// <summary>/// Android ApiKey/// </summary>private readonly string AppKey = ConfigurationManager.AppSettings["AppKey"];/// <summary>/// Android密码/// </summary>private readonly string APIMasterSecret = ConfigurationManager.AppSettings["MasterSecret"];/// <summary>/// Android极光推送:开始推送方法/// </summary>/// <param name="RegistrationID">设备号 RV1D41L5F1T</param>public void PushAndroid(string RegistrationID){try{Random ran = new Random();int sendno = ran.Next(1, 2100000000);//随机生成的一个编号string app_key = AppKey;string masterSecret = APIMasterSecret;int receiver_type = 4;//接收者类型。2、指定的 tag。3、指定的 alias。4、广播:对 app_key 下的所有用户推送消息。5、根据 RegistrationID 进行推送。当前只是 Android SDK r1.6.0 版本支持string receiver_value = RegistrationID;/*int msg_type = 1;//1、通知   2、自定义消息(只有 Android 支持)//通过json来推送消息内容。title-标题 content-推送的内容string Title = "要推送的标题";string Content = "要推送的内容";string msg_content = "{\"n_builder_id\":\"00\",\"n_title\":\"" + Title + "\",\"n_content\":\"" + Content + "\"}";//消息内容*//*当调用参数 msg_type = 1(通知) 时,msg_content JSON 要求:Key名称        是否必须    Value内容说明n_builder_id   可选        1-1000的数值,不填则默认为 0,使用 极光Push SDK 的默认通知样式。只有 Android 支持这个参数。n_title        可选        通知标题。不填则默认使用该应用的名称。只有 Android支持这个参数。n_content      必须        通知内容。n_extras       可选        通知附加参数。JSON格式。客户端可取得全部内容。*/int msg_type = 2;//1、通知   2、自定义消息(只有 Android 支持)//通过json来推送消息内容。title-标题 content-推送的内容string msg_content = "{\"message\":\"xxxx12344554\"}";//消息内容/*当调用参数 msg_type = 2(自定义消息) 时,msg_content JSON 要求:Key名称       是否必须     Value内容说明message          必须         自定义消息的内容。content_type    可选         message 字段里的内容类型。用于特定的 message 内容解析title            可选         消息标题extras           可选         原样返回,JSON 格式的更多的附属信息*/string platform = "android";//目标用户终端手机的平台类型,如: android, ios 多个请使用逗号分隔。string verification_code = GetMD5Str(sendno.ToString(), receiver_type.ToString(), receiver_value, masterSecret);//验证串,用于校验发送的合法性。MD5/*string postData = "sendno=" + sendno;postData += ("&app_key=" + app_key);postData += ("&masterSecret=" + masterSecret);postData += ("&receiver_type=" + receiver_type);postData += ("&receiver_value=" + receiver_value);postData += ("&msg_type=" + msg_type);postData += ("&msg_content=" + msg_content);postData += ("&platform=" + platform);postData += ("&verification_code=" + verification_code);*/string postData = "sendno=" + sendno;postData += ("&app_key=" + app_key);//postData += ("&masterSecret=" + masterSecret);
postData += ("&receiver_type=" + receiver_type);postData += ("&receiver_value=" + receiver_value);postData += ("&verification_code=" + verification_code);postData += ("&msg_type=" + msg_type);postData += ("&msg_content=" + msg_content);postData += ("&platform=" + platform);//byte[] data = encoding.GetBytes(postData);byte[] data = Encoding.UTF8.GetBytes(postData);string resCode = GetPostRequest(data);//调用极光的接口获取返回值
HttpContext.Current.Response.Write(resCode);JpushMsg  msg = Newtonsoft.Json.JsonConvert.DeserializeObject<JpushMsg>(resCode);//定义一个JpushMsg类,包含返回值信息,将返回的json格式字符串转成JpushMsg对象 /*失败json:{"sendno":"344076014","msg_id":2554996103,"errcode":1011,"errmsg":"cannot find user by this audience"} 成功json:{"sendno":"480383770","msg_id":"847350150","errcode":0,"errmsg":"Succeed"}*发送自定义消息时:{"sendno":"1344179834","errcode":1003,"errmsg":"msg_content should be JSON format"}{"sendno":"151526149","msg_id":3635937751,"errcode":1003,"errmsg":"message should be in msg_content as a JSON key"}参考地址:http://docs.jpush.cn/display/dev/Push-API-v3**/}catch (Exception ex){HttpContext.Current.Response.Write(ex.Message);}}/// <summary>/// MD5加密验证字符串,用于调用接口的时候,极光将做验证使用/// </summary>/// <param name="paras">参数数组</param>/// <returns>MD5字符串</returns>public string GetMD5Str(params string[] paras){string str = "";for (int i = 0; i < paras.Length; i++){str += paras[i];}byte[] buffer = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(str));string md5Str = string.Empty;for (int i = 0; i < buffer.Length; i++){md5Str = md5Str + buffer[i].ToString("X2");}return md5Str;}/// <summary>/// Post方式请求获取返回值/// </summary>/// <param name="data"></param>/// <returns></returns>public string GetPostRequest(byte[] data){HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://api.jpush.cn:8800/v2/push");myRequest.Method = "POST";//极光http请求方式为post
myRequest.ContentType = "application/x-www-form-urlencoded";//按照极光的要求
myRequest.ContentLength = data.Length;Stream newStream = myRequest.GetRequestStream();// Send the data.
newStream.Write(data, 0, data.Length);newStream.Close();// Get responsevar response = (HttpWebResponse)myRequest.GetResponse();using (var reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("UTF-8"))){string result = reader.ReadToEnd();reader.Close();response.Close();return result;}}}类JpushMsg代码:using System;using System.Collections.Generic;using System.Linq;using System.Web;/// <summary>/// 接收返回值信息/// </summary>public class JpushMsg{private string sendno;//编号public string Sendno{get { return sendno; }set { sendno = value; }}private string msg_id;//信息编号public string Msg_id{get { return msg_id; }set { msg_id = value; }}private string errcode;//返回码public string Errcode{get { return errcode; }set { errcode = value; }}private string errmsg;//错误信息public string Errmsg{get { return errmsg; }set { errmsg = value; }}}新加web页面Default.aspx添加控件 V3-推送:<asp:Button ID="btnPushV3" Text="V3-推送" runat="server" οnclick="btnPushV3_Click" /><br />Default.aspx.cs按钮事件代码:protected void btnPushV3_Click(object sender, EventArgs e){JPushV3 util = new JPushV3();/*registration_id{"platform":"all","audience":"all","notification":{"alert":"Test from  C# v3 sdk - alert-你好"},"options":{"apns_production":false}}*///string reqParams = "{\"platform\":\"all\",\"audience\":\"all\",\"notification\":{\"alert\":\"Test from  C# v3 sdk - alert-你好\"},\"options\":{\"apns_production\":false}}";//string reqParams = "{\"platform\":[\"android\",\"ios\"],\"audience\":{\"tag\":[\"tag1\",\"tag2\"]},\"message\":{\"msg_content\":\"自定义消息测试:Test from C# v3 sdk - msgContent\",\"extras\":{\"from\":\"JPush\"}},\"options\":{\"apns_production\":false}}";//string reqParams = "{\"platform\":[\"android\",\"ios\"],\"audience\":\"all\",\"message\":{\"msg_content\":\"自定义消息测试:Test from C# v3 sdk - msgContent\",\"title\":\"广通测试标题\",\"extras\":{\"from\":\"JPush\"}},\"options\":{\"apns_production\":false}}";string reqParams = "{\"platform\":[\"android\",\"ios\"],\"audience\":{\"alias\":[\"1899\"]},\"message\":{\"msg_content\":\"自定义消息测试:您有新的公文需要办理\",\"title\":\"广通测试标题注册ID\",\"extras\":{\"from\":\"JPush\"}},\"options\":{\"sendno\":12345678}}";//reqParams = "{\"platform\":[\"android\",\"ios\"],\"audience\":{\"alias\":[\"1001\"]},\"message\":{\"msg_content\":\"自定义消息测试:您有新的公文需要办理\",\"title\":\"广通测试标题注册ID\",\"extras\":{\"from\":\"JPush\"}},\"options\":{\"apns_production\":false}}";string jsonString = util.SendPostRequest(reqParams);Response.Write(jsonString + "<br />");string errorMessage = "";string errorCode = "";string sendno = "";string msg_id = "";bool processResult = util.IsSuccess(jsonString, out errorMessage, out errorCode, out sendno, out msg_id);Response.Write("errorMessage:" + errorMessage + "<br />");Response.Write("errorCode:" + errorCode + "<br />");Response.Write("sendno:" + sendno + "<br />");Response.Write("msg_id:" + msg_id + "<br />");/*//遇到json的值中含有\"请使用\\\"来转义reqParams = "{\"platform\":[\"android\",\"ios\"],\"audience\":{\"alias\":[\"1001\"]},\"message\":{\"msg_content\":\"自定义消息测试:您有\\\"新的公文需要办理\",\"title\":\"广通测试标题注册ID\",\"extras\":{\"from\":\"JPush\"}},\"options\":{\"apns_production\":false}}";result = util.SendPostRequest(reqParams);Response.Write(result + "<br />");*///string result = util.GetReceivedResult("1799597405");//Response.Write(result + "<br />");/** 正确时返回结果{"sendno":"123456","msg_id":"1799597405"}* {"sendno":"0","msg_id":"351403900"}* 入参json完全正确,但找不到要到达的设备。错误时:返回 {"msg_id": 3125719446, "error": {"message": "cannot find user by this audience", "code": 1011}}* 传入空字符串 或者 非json格式,或者没有必须的选项:{"error": {"message": "Missing parameter", "code": 1002}}* 传入的键值不符合要求 {"error": {"message": "Audience value must be JSON Array format!", "code": 1003}}  键区分大小写*/}运行效果:

转载于:https://www.cnblogs.com/yangwujun/p/5973120.html

使用极光推送(www.jpush.cn)向安卓手机推送消息【服务端向客户端主送推送】C#语言...相关推荐

  1. springboot实现SSE服务端主动向客户端推送数据,java服务端向客户端推送数据,kotlin模拟客户端向服务端推送数据

    SSE服务端推送 服务器向浏览器推送信息,除了 WebSocket,还有一种方法:Server-Sent Events(以下简称 SSE).本文介绍它的用法. 在很多业务场景中,会涉及到服务端向客户端 ...

  2. flux服务器推消息,服务端主动推送数据,除了 WebSocket 你还能想到啥?

    原标题:服务端主动推送数据,除了 WebSocket 你还能想到啥? 来自公众号: 江南一点雨 在 上篇文章 中,松哥和大家分享了 WebFlux 的基本用法,小伙伴们已经了解到使用 WebFlux ...

  3. Asp.net webApi 通过WebSocket推送消息给客户端,搭建一个即是服务端又是客户端的服务

    Asp.net webApi 通过WebSocket推送消息给客户端,搭建一个即是服务端又是客户端的服务_IT_ziliang的博客-CSDN博客 WebSocket是一种在单个TCP连接上进行全双工 ...

  4. 你的安卓手机为什么会卡-Android混乱生态的缺位者:推送

    跟同事聊天聊到推送相关的问题,有感而发,正好可以水一篇- 安卓手机容易卡? 安卓手机为什么会卡或者说国内的安卓手机为什么会这么容易卡,国内混乱的Android生态可能就是罪魁祸首. 其中我认为 缺少统 ...

  5. 易语言服务端与客户端怎么传送_配置中心是怎么推送的?动手实现一个 Long Polling 长轮询...

    介绍 众所周知,数据交互有两种模式:Push(推模式).Pull(拉模式). 推模式指的是客户端与服务端建立好网络长连接,服务方有相关数据,直接通过长连接通道推送到客户端.其优点是及时,一旦有数据变更 ...

  6. sse服务器推送性能,SSE 服务端向客户端推送

    传统的ajax都是由客户端主动去请求,服务端才可以返回数据 而sse是建立一个通道,并且在断线后自动重连,由服务端去推送,不需要客户端去主动请求,只需要建立通道 websocket是双向通信 客户端可 ...

  7. java websocket修改为同步_服务端向客户端推送消息技术之websocket的介绍

    websocket的介绍 在讲解WebSocket前,我们先来看看下面这种场景,在HTTP协议下,怎么实现. 需求: 在网站中,要实现简单的聊天,这种情况怎么实现呢?如下图: ​ 当发送私信的时候,如 ...

  8. winform服务器消息推送,winform项目——仿QQ即时通讯程序12:服务端程序补充及优化...

    原标题:winform项目--仿QQ即时通讯程序12:服务端程序补充及优化 上一篇文章大概完成了服务端程序,今天继续做项目的时候发现还有一些功能没有做,还有几处地方不够完善.不做好就会影响客户端程序的 ...

  9. 用JPUSH极光推送实现服务端向安装了APP应用的手机推送消息(C#服务端接口)

    这次公司要我们做一个功能,就是当用户成功注册以后,他登录以后要收到消息,当然这个消息是安装了我们的手机APP应用的手机咯. 极光推送的网站的网址是:https://www.jpush.cn/ 极光推送 ...

  10. 如何用好消息推送(JPush)为app拉新、留存、促活

    如何用好消息推送(JPush)为app拉新.留存.促活 作为移动端APP产品运营最重要的运营手段,消息推送(JPush)被越来越多的APP厂商所重视,在信息泛滥的移动互联网时代,手机APP应用安装得越 ...

最新文章

  1. 生产者/消费者模型详解(基于Java)
  2. postman显示服务器错误是什么原因,Postman 500内部服务器错误api错误
  3. leetcode算法题--矩阵中的路径
  4. docker分离部署lnmp
  5. php memcache可存,php使用memcache共享存储session(二)
  6. Java enum枚举
  7. 八款JS框架介绍及比较
  8. raspberry pi_如何为Raspberry Pi编写SD卡
  9. 腾讯AI加速器三期全球招募开启,打造AI+产业生力军
  10. python中else与for_在Python中使用else条件语句和for循环
  11. Unity3D学习笔记——layer
  12. freeswitch安装1.6
  13. java异或_干货:Java异或运算符的使用方法
  14. 高速缓存(cache)原理
  15. ps无法打开计算机缺失文件,ps打开出现dll文件丢失怎么解决
  16. 前端开发都有什么编程语言?
  17. [汇总]Flex面试题及答案
  18. 用python写名片管理系统
  19. PPT制作和美化插件工具
  20. RabbitMQ初步到精通-第十章-RabbitMQ之Spring客户端源码

热门文章

  1. linux jconsole 监控jvm,JVM监测分析JConsole
  2. C语言--fseek()
  3. 诺基亚5320XM 上的最好的手机浏览器,UCWEB 6
  4. android支持u盘格式文件,安卓系统OTG支持U盘格式
  5. 四核网络机顶盒芯片局势分析(开放市场):rk3128将会成为四核主流
  6. LINUX重新编译BIN固件,固件编译
  7. 研发部工作日志使用教程
  8. adb 静默安装_apk 静默安装
  9. 几个不知道算不算经典的游戏
  10. 打印服务器后台程序没有运行,打印后台程序服务没有运行