private bool JPush(ReturnDalInfo info, string alarmContent, out string result) { JPush.SendMod j = JPushMod(info, alarmContent); Log.Warn("UserToken:" + info.UserToken + " AppcardType:" + j.Content.CardCode + " 通信令牌:" + j.Token); JPush jp = new JPush(j); return(jp.Send(out result)); }
private JPush.SendMod JPushMod(ReturnDalInfo info, string content) { JPush.SendMod j = new JPush.SendMod(); j.Token = Token(info.AppcardType); j.DataTypeCode = "SendPush"; j.Content.MessageId = Guid.NewGuid().ToString("N");; //自己生成的guid j.Content.OpenId = info.UserToken; //就是接芳的传过来的usertoken j.Content.CardCode = info.AppcardType; //接芳传过来的 appcardtype。 j.Content.Message = content; //发送内容。 j.Content.MessageType = "2"; j.Content.Extras = Info.Reason; j.Content_Json = Json.Serialize <JPush.SendMod.content>(j.Content); return(j); }
private JPush.SendMod JPushMod_New(ReturnDalInfo info, string content) { JPush.SendMod j = new JPush.SendMod(); j.Content.App_Key = Config.JPushConfig.AppKeyList[0].AppKey; //通过过程取得。 j.Content.Master_Secret = Config.JPushConfig.AppKeyList[0].MasterSecret; //通过过程取得。 j.Content.ChannelID = info.PUSHAPPID; //通过过程取得。 j.Token = ""; j.DataTypeCode = "SendPush_CM"; j.Content.MessageId = Guid.NewGuid().ToString("N");; //自己生成的guid j.Content.OpenId = info.UserToken; //就是接芳的传过来的usertoken j.Content.CardCode = info.AppcardType; //接芳传过来的 appcardtype。 j.Content.Message = content; //发送内容。 j.Content.MessageType = "2"; j.Content.Extras = Info.Reason; j.Content_Json = Json.Serialize <JPush.SendMod.content>(j.Content); return(j); }