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, "")); } }
public AccountController(IUserAppService userAppService, IIntegralAppService integralAppService, IHostingEnvironment env, JPushHelper jPushHelper) { _userAppService = userAppService; _appConfiguration = AppConfigurations.Get(env.ContentRootPath, env.EnvironmentName); _integralService = integralAppService; _env = env; _jpushHelper = jPushHelper; }
public UserAppService(IRepository <WOrder_Account, long> userRepository, IRepository <WOrder_AttachFile> fileRepository, IRealTimeNotifier realTimeNotifier, JPushHelper jPushHelper) : base(userRepository) { _accountRepository = userRepository; _fileRepository = fileRepository; _realTimeNotifier = realTimeNotifier; _jpushHelper = jPushHelper; }
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); }
public OrderAppService(IRepository <WOrder_Order, long> orderRepository, IRepository <WOrder_Handler> handlerRepository, IRepository <WOrder_AttachFile> fileRepository, JPushHelper jpushHelper, IRealTimeNotifier realTimeNotifier, IMessageAppService messageService, IRepository <WOrder_Relation> relationRepository ) : base(orderRepository) { _orderRepository = orderRepository; _handlerRepository = handlerRepository; _fileRepository = fileRepository; _jpushHelper = jpushHelper; _realTimeNotifier = realTimeNotifier; _relationRepository = relationRepository; _messageService = messageService; }