| | |
| | | } |
| | | |
| | | private static Message.Builder getMessageBuidler(PushTypeEnum type, String title, String content, String activity, |
| | | String url, String webUrl, Long id) { |
| | | String url, String webUrl, String id) { |
| | | Map<String, String> data = new HashMap<>(); |
| | | if (type != null) |
| | | data.put("type", type.name()); |
| | |
| | | * @param goodsId |
| | | * @throws PushException |
| | | */ |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, Long goodsId) |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, String goodsId,String androidBaseActivity) |
| | | throws PushException { |
| | | if (registerIds != null && registerIds.size() > 500) |
| | | throw new PushException(1, "设备数不能超过500个"); |
| | | |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() |
| | | String activity = androidBaseActivity |
| | | + ".ui.recommend.GoodsBrowserActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.goodsdetail, title, content, activity, null, null, |
| | | goodsId); |
| | |
| | | * -网页链接 |
| | | * @throws PushException |
| | | */ |
| | | public static void pushUrl(List<String> registerIds, String title, String content, String url) |
| | | public static void pushUrl(List<String> registerIds, String title, String content, String url,String androidBaseActivity) |
| | | throws PushException { |
| | | if (registerIds != null && registerIds.size() > 500) |
| | | throw new PushException(1, "设备数不能超过500个"); |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.invite.ShareBrowserActivity"; |
| | | String activity = androidBaseActivity + ".ui.invite.ShareBrowserActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.url, title, content, activity, null, url, null); |
| | | try { |
| | | boolean success = push(registerIds, builder); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushWEEX(List<String> registerIds, String title, String content, String weexUrl) |
| | | public static void pushWEEX(List<String> registerIds, String title, String content, String weexUrl,String androidBaseActivity) |
| | | throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() |
| | | String activity = androidBaseActivity |
| | | + ".ui.mine.weex.WeexApplicationActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.weex, title, content, activity, weexUrl, weexUrl, |
| | | null); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushWelfareCenter(List<String> registerIds, String title, String content) throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.mine.WelfareCenterActivity"; |
| | | public static void pushWelfareCenter(List<String> registerIds, String title, String content,String androidBaseActivity) throws PushException { |
| | | String activity = androidBaseActivity + ".ui.mine.WelfareCenterActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.welfare, title, content, activity, null, null, null); |
| | | try { |
| | | boolean success = push(registerIds, builder); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushUserSignInNotification(List<String> registerIds, String title, String content) |
| | | public static void pushUserSignInNotification(List<String> registerIds, String title, String content,String androidBaseActivity) |
| | | throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.goldtask.GoldTaskActivity"; |
| | | String activity = androidBaseActivity + ".ui.goldtask.GoldTaskActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.signin, title, content, activity, null, null, null); |
| | | try { |
| | | boolean success = push(registerIds, builder); |