public override void GetSign(XGPushChannelSetting channelSetting) { StringBuilder sbParam = new StringBuilder(); sbParam.Append(channelSetting.XGSingleDevice_RestAPI_Method); sbParam.Append(channelSetting.XGSingleDevice_RestAPI_Url); Dictionary <string, string> dicParam = new Dictionary <string, string>(); dicParam.Add("access_id", this.AccessId.ToString()); dicParam.Add("timestamp", this.TimeStamp.ToString()); dicParam.Add("device_token", this.DeviceToken); dicParam.Add("message_type", this.MessageType.ToString()); dicParam.Add("message", this.Message.ToString()); dicParam.Add("expire_time", this.ExpireTime.ToString()); dicParam.Add("send_time", this.SendTime); dicParam.Add("multi_pkg", this.MultiPkg.ToString()); var sortedDic = dicParam.OrderBy(k => k.Key); foreach (var item in sortedDic) { sbParam.AppendFormat("{0}={1}", item.Key, item.Value); } sbParam.Append(channelSetting.Secret_Key); this.Sign = MD5Helper.GetMD5(sbParam.ToString()); }
public XGPushChannel(XGPushChannelSetting setting) { pushChannelSetting = setting; }
public virtual void GetSign(XGPushChannelSetting channelSetting) { }
public XGPushChannel() { pushChannelSetting = new XGPushChannelSetting(); }