亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

正在回答

1 回答

? ? public void sendBroadcast(String apiKey, String title, String message,

? ? ? ? ? ? String uri) {

? ? ? ? log.debug("sendBroadcast()...");

? ? ? ? List<User> users = userService.getUsers(); //把表中數據全部拿出來

? ? ? ? for (User user : users) {

? ? ? ? Random random = new Random();

? ? ? ? String id = Integer.toHexString(random.nextInt());

? ? //在這里,不關心 服務器端有沒有推,后續由客戶端進行反饋

saveNotification(apiKey, user.getUsername(), title, message, uri, id); //前置

? ? ? ? IQ notificationIQ = createNotificationIQ(id,apiKey, title, message, uri);

ClientSession session = sessionManager.getSession(user.getUsername());

if(session != null&&session.getPresence().isAvailable()){

notificationIQ.setTo(session.getAddress());

? ? ? ? ? ? ? ? session.deliver(notificationIQ);

}

? ? ? ? }

這么改就解決

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

我的別名推送問題

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號