| | |
| | | * @param system
|
| | | * @return
|
| | | */
|
| | | public static String singlePushAndroidForXM(MessageInfo info, Map<String, Object> map, System system) {
|
| | | public static String singlePushAndroidForXM(MessageInfo info, Map<String, Object> map, List<String> regIds,
|
| | | System system) {
|
| | | String name = info.getPackageName();
|
| | | if (!Constant.systemCommonConfig.getAndroidPackageName().equalsIgnoreCase(name)
|
| | | && !Constant.systemCommonConfig.getIosBundleId().equalsIgnoreCase(name)) {
|
| | |
| | | }
|
| | | message = builder.build();
|
| | | try {
|
| | | Result result = sender.sendToAlias(message, uId, 3);
|
| | | Result result = sender.send(message, regIds, 3); // sender.sendToAlias(message,
|
| | | // uId, 3);
|
| | | PushLogHelper.xmInfo("推送结果:" + result.getReason());
|
| | | return result.getMessageId();
|
| | | } catch (IOException e) {
|
| | |
| | | * @author mawurui createTime 2018年3月8日 上午9:55:14
|
| | | * @param info
|
| | | */
|
| | | public static void pushByHongBao(String alias, System system) {
|
| | | public static void pushByHongBao(List<String> regIds, System system) {
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setAlias(alias);
|
| | | info.setTitle("新到红包");
|
| | | info.setDescription("红包到来了...");
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | jsonObject.put("type", "hongbao");
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), system);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), regIds, system);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @author mawurui createTime 2018年3月8日 上午10:00:16
|
| | | * @param info
|
| | | */
|
| | | public static void pushByApply(String alias, System system) {
|
| | | public static void pushByApply(List<String> regIds, System system) {
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setAlias(alias);
|
| | | info.setTitle("提现申请");
|
| | | info.setDescription("提现审核中...");
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | jsonObject.put("type", "cash");
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), system);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), regIds, system);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param state
|
| | | * @param system
|
| | | */
|
| | | public static void pushByExtract(String alias, int state, System system) {
|
| | | public static void pushByExtract(List<String> regIds, int state, System system) {
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setAlias(alias);
|
| | | if (state == 0) {
|
| | | info.setTitle("提现成功");
|
| | | info.setDescription("您有一笔交易,已提现成功!");
|
| | |
| | | }
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | jsonObject.put("type", "cash");
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), system);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), regIds, system);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static void pushZNX(Long uid, String title, String content, String msgId) {
|
| | | public static void pushZNX(List<String> regIds, String title, String content, String msgId) {
|
| | | // 小米开始推送
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setActivty(
|
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName()));
|
| | | info.setAlias(uid + "");
|
| | | info.setTitle(title);
|
| | | info.setContent(content);
|
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName());
|
| | |
| | | contentJson.put("createTime", java.lang.System.currentTimeMillis());
|
| | | json.put("content", contentJson);
|
| | | JSONObject mapXm = JSONObject.fromObject(json);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm, null);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm,regIds, null);
|
| | | }
|
| | |
|
| | | }
|