| | |
| | |
|
| | | 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-使用默认震动提示,
|
| | |
| | |
|
| | | 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-使用默认震动提示,
|
| | |
| | | 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()) {
|
| | |
| | | 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);
|
| | | }
|
| | |
|
| | | }
|