yujian
2020-05-23 28cf328a098334b51a3e9d2d56f983fb8c862211
fanli/src/main/java/com/yeshi/fanli/util/push/PushUtils.java
@@ -66,6 +66,9 @@
       * Constant.systemCommonConfig.getIosBundleId());
       */
      if (Constant.IS_TEST)
         return 1;
      String IOS = IOSPushUtil.allPushIOS(deviceTokenList, info, url, type);
      LogHelper.userInfo("IOS的推送日志:" + IOS);
      pushRecord.setIosPushId(IOS);
@@ -84,13 +87,34 @@
    * @param json
    * @return
    */
   public static int singlePushXiaoMi(MessageInfo info, JSONObject json, PushRecord pushRecord) {
   public static int singlePushXiaoMi(MessageInfo info, JSONObject json,List<String> regIds, PushRecord pushRecord) {
//      if (Constant.IS_TEST)
//         return 1;
      JSONObject mapXm = JSONObject.fromObject(json);
      String android = XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm,regIds, null);
      LogHelper.userInfo("安卓推送测试:" + android);
      pushRecord.setAndroidPushId(android);
      if (android != null) {
         return 1;
      } else {
         return 4;
      }
   }
   public static int singlePushXiaoMiByRegisterId(MessageInfo info, JSONObject json, PushRecord pushRecord,
         String regId) {
      if (Constant.IS_TEST)
         return 1;
      JSONObject mapXm = JSONObject.fromObject(json);
      String android = XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm, null);
      List<String> regIdList = new ArrayList<>();
      regIdList.add(regId);
      String android = XiaoMiPushUtil.pushBatchAndroidForXM(info, mapXm, regIdList);
      LogHelper.userInfo("安卓推送测试:" + android);
      pushRecord.setAndroidPushId(android);
@@ -113,6 +137,8 @@
    */
   public static String singlePushIOS(MessageInfo info, PushRecord pushRecord, String url, int type,
         List<String> deviceTokenList) {
      if (Constant.IS_TEST)
         return null;
      if (deviceTokenList != null && deviceTokenList.size() > 0) {
         for (String deviceToken : deviceTokenList) {
            if (!StringUtil.isNullOrEmpty(deviceToken)) {