| | |
| | | masterSecret = config.getAppSecret(); |
| | | } |
| | | |
| | | private static Map<String, String> getParams(String type, String activity, String url, String webUrl, Long id) { |
| | | private static Map<String, String> getParams(String type, String activity, String url, String webUrl, String id) { |
| | | Map<String, String> data = new HashMap<>(); |
| | | if (type != null) |
| | | data.put("type", type); |
| | |
| | | * @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() > 100) |
| | | throw new PushException(1, "设备数不能超过100个"); |
| | | |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() |
| | | String activity =androidBaseActivity |
| | | + ".ui.recommend.GoodsBrowserActivity"; |
| | | Map<String, String> params = getParams("goodsdetail", 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() > 100) |
| | | throw new PushException(1, "设备数不能超过1000个"); |
| | | |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.invite.ShareBrowserActivity"; |
| | | String activity =androidBaseActivity + ".ui.invite.ShareBrowserActivity"; |
| | | Map<String, String> params = getParams("url", activity, null, url, null); |
| | | try { |
| | | boolean success = push(registerIds, title, content, params); |
| | |
| | | * 最大值1000 |
| | | * @param title |
| | | * @param content |
| | | * @param url |
| | | * -网页链接 |
| | | * @throws PushException |
| | | */ |
| | |
| | | } |
| | | } |
| | | |
| | | 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"; |
| | | Map<String, String> params = getParams("weex", activity, weexUrl, weexUrl, null); |
| | | if (params == 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"; |
| | | Map<String, String> params = getParams("welfare", activity, null, null, null); |
| | | if (params == null) |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | 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"; |
| | | Map<String, String> params = getParams("signin", activity, null, null, null); |
| | | if (params == null) |
| | | return; |