admin
2020-05-06 24a8d17e007545f7426c48352109aa1a9c6587ee
fanli/src/main/java/com/yeshi/fanli/util/push/XiaoMiPushUtil.java
@@ -76,6 +76,7 @@
      Message message = null; // 做循环传来的key
      Builder builder = new Message.Builder().restrictedPackageName(PackageName).title(title).payload(payload)
            .notifyId((int) (Math.random() * Integer.MAX_VALUE))
            .description(description).passThrough(0) // 设置消息是否通过透传方式至App,
                                             // 1表示透传,0表示通知栏消息(默认)
            .notifyType(1); // 设置通知类型, type类型(1-默认提示音, 2-使用默认震动提示,
@@ -129,6 +130,7 @@
      Message message = null; // 做循环传来的key
      Builder builder = new Message.Builder().restrictedPackageName(PackageName).title(title).payload(payload)
            .notifyId((int) (Math.random() * Integer.MAX_VALUE))
            .description(description).passThrough(0) // 设置消息是否通过透传方式至App,
                                             // 1表示透传,0表示通知栏消息(默认)
            .notifyType(1); // 设置通知类型, type类型(1-默认提示音, 2-使用默认震动提示,
@@ -178,8 +180,10 @@
      Message message = null; // 做循环传来的key
      Builder builder = new Message.Builder().restrictedPackageName(PackageName).title(title).description(content)
            .passThrough(0) // 设置消息是否通过透传方式至App, 1表示透传,0表示通知栏消息(默认)
            .notifyType(1); // 设置通知类型, type类型(1-默认提示音, 2-使用默认震动提示,
                        // 3-使用默认led灯光提示)
            .notifyId((int) (Math.random() * Integer.MAX_VALUE)).notifyType(1); // 设置通知类型,
                                                               // type类型(1-默认提示音,
                                                               // 2-使用默认震动提示,
      // 3-使用默认led灯光提示)
      // 将extra放入MessageInfo对象中, 循环遍历extra中的key 和 value
      if (map != null) {
         for (String key : map.keySet()) {
@@ -299,7 +303,7 @@
      contentJson.put("createTime", java.lang.System.currentTimeMillis());
      json.put("content", contentJson);
      JSONObject mapXm = JSONObject.fromObject(json);
      XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm,regIds, null);
      XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm, regIds, null);
   }
}