From b1c4bba2aa126d329a2c5bb84ccb413e16b26278 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Wed, 7 Sep 2022 15:11:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3=EF=BC=9A?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/sms/PushHelper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/xkrs/sms/PushHelper.java b/src/main/java/com/xkrs/sms/PushHelper.java index 62b70a9..432430c 100644 --- a/src/main/java/com/xkrs/sms/PushHelper.java +++ b/src/main/java/com/xkrs/sms/PushHelper.java @@ -1,7 +1,9 @@ package com.xkrs.sms; +import com.xiaomi.push.sdk.ErrorCode; import com.xiaomi.xmpush.server.Constants; import com.xiaomi.xmpush.server.Message; +import com.xiaomi.xmpush.server.Result; import com.xiaomi.xmpush.server.Sender; import com.xkrs.model.entity.FirePointEntity; import com.xkrs.model.entity.SysUserEntity; @@ -72,6 +74,8 @@ public class PushHelper { // 注:key和value的字符数不能超过1024, 至多可以设置10个key-value键值对) // messageBuilder.extra("",""); Message message = messageBuilder.build(); - sender.sendToUserAccount(message, userAccountList, 3);//根据accountList, 发送消息到指定设备上 + Result result = sender.sendToUserAccount(message, userAccountList, 3);//根据accountList, 发送消息到指定设备上 + ErrorCode errorCode = result.getErrorCode(); + String reason = result.getReason(); } }