public bool PushByKey(string pushKey, string tiker, string title, string text, Dictionary <string, object> objs) { UmengData data = GetPushData(tiker, tiker, text, objs); data.SetAlias(pushKey); return(Push("http://msg.umeng.com/api/send", data)); }
public bool PushAll(string tiker, string title, string text, Dictionary <string, object> objs) { UmengData data = GetPushData(tiker, tiker, text, objs); data.type = CastType.broadcast; return(Push("http://msg.umeng.com/api/send", data)); }
private UmengData GetPushData(string tiker, string title, string text, Dictionary <string, object> objs) { UmengData data = new UmengData(); data.payload.SetTicker(tiker); data.payload.SetTitle(title); data.payload.SetText(text); data.extra = objs; return(data); }
private bool Push(string url, UmengData data) { string body = data.ToJsonString(); var sign = GetSign(url, body); var pushUrl = string.Format("{0}?sign={1}", url, sign); WebClient client = new WebClient(); var rep = client.UploadString(pushUrl, body); _logger.Info(rep); return(true); }