public ResResultModel SendPush(PushFmModel model) { try { JPushHelper jpush = new JPushHelper(); JPushOptionInfo pushOptionInfo = null; if (!string.IsNullOrWhiteSpace(model.Alias)) { pushOptionInfo = new JPushOptionInfo { Title = model.Title, Content = model.Content, Alias = model.Alias, PushPayloadType = EnumPushPayloadType.Alias } } ; else { pushOptionInfo = new JPushOptionInfo { Title = model.Title, Content = model.Content, PushPayloadType = EnumPushPayloadType.All } }; var isOk = jpush.SendPush(pushOptionInfo); if (!isOk) { return(ResResult.Response(false, MC.M_Save_Error, "")); } return(ResResult.Response(true, "", "")); } catch (Exception ex) { return(ResResult.Response(false, ex.Message, "")); } }
static void Main(string[] args) { //MobileClient client = new MobileClient(); //var s = client.GetHelloWord(); //var s = client.ValidateUser("admin", "ccecc123"); //极光推送 JPushHelper jpush = new JPushHelper(); var pushOptionInfo = new JPushOptionInfo { Title = "任务通知1", Content = "您好,任务通知1,请按时完成!", Alias = "01010101", PushPayloadType = EnumPushPayloadType.Alias }; var isOk = jpush.SendPush(pushOptionInfo); }