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(); } }