添加接口:测试推送
This commit is contained in:
parent
d5dd11ef3a
commit
b1c4bba2aa
@ -1,7 +1,9 @@
|
|||||||
package com.xkrs.sms;
|
package com.xkrs.sms;
|
||||||
|
|
||||||
|
import com.xiaomi.push.sdk.ErrorCode;
|
||||||
import com.xiaomi.xmpush.server.Constants;
|
import com.xiaomi.xmpush.server.Constants;
|
||||||
import com.xiaomi.xmpush.server.Message;
|
import com.xiaomi.xmpush.server.Message;
|
||||||
|
import com.xiaomi.xmpush.server.Result;
|
||||||
import com.xiaomi.xmpush.server.Sender;
|
import com.xiaomi.xmpush.server.Sender;
|
||||||
import com.xkrs.model.entity.FirePointEntity;
|
import com.xkrs.model.entity.FirePointEntity;
|
||||||
import com.xkrs.model.entity.SysUserEntity;
|
import com.xkrs.model.entity.SysUserEntity;
|
||||||
@ -72,6 +74,8 @@ public class PushHelper {
|
|||||||
// 注:key和value的字符数不能超过1024, 至多可以设置10个key-value键值对)
|
// 注:key和value的字符数不能超过1024, 至多可以设置10个key-value键值对)
|
||||||
// messageBuilder.extra("","");
|
// messageBuilder.extra("","");
|
||||||
Message message = messageBuilder.build();
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user