Android QuickBlox SDK 客户端未连接或不再连接
Android QuickBlox SDK Client is not, or no longer, connected
正在尝试从本地保存在房间数据库模型中的对话实例加入对话。它给了我这个错误。但是,当我从服务器获取对话框时工作正常。
public QBChatDialog getDialogFromDialogModel(ChatDialogModel mChatDialogModel) {
QBChatDialog mQBChatDialog = new QBChatDialog();
mQBChatDialog.setRoomJid(mChatDialogModel.getRoomJid());
mQBChatDialog.setRoomJid(mChatDialogModel.getRoomJid());
mQBChatDialog.setDialogId(mChatDialogModel.getDialogId());
mQBChatDialog.setName(mChatDialogModel.getName());
List<Integer> occupants = new ArrayList<>();
String[] arrayoccu = mChatDialogModel.getOccupantsIds().split(",");
occupants.add(Integer.parseInt(arrayoccu[0]));
occupants.add(Integer.parseInt(arrayoccu[1]));
mQBChatDialog.setOccupantsIds(occupants);
mQBChatDialog.setLastMessage(mChatDialogModel.getLastMessage());
mQBChatDialog.setUnreadMessageCount(mChatDialogModel.getUnreadMessageCount());
mQBChatDialog.setUserId(mChatDialogModel.getUserId());
mQBChatDialog.setType(QBDialogType.GROUP);
mQBChatDialog.setLastMessageDateSent(mChatDialogModel.getLastMessageDateSent());
mQBChatDialog.setLastMessageUserId(mChatDialogModel.getLastMessageUserId());
return mQBChatDialog;
}
qbChatDialog = qbChatHelper.getDialogFromDialogModel(dialogModel);
DiscussionHistory discussionHistory = new DiscussionHistory();
discussionHistory.setMaxStanzas(0);
qbChatDialog.join(discussionHistory, dialogJoinedCallback);
I/QBChatDialog: join to QBChatDialog{id=5d93e886424a796de0b87be3, created_at=null, updated_at=null, last_msg_user_id=0, occupants_ids=[83435042, 83435082], last_message=null, last_message_date_sent=0, type=GROUP, name=5d93dad7424a796de0b87b8c, room_jid=75367_5d93e886424a796de0b87be3@muc.chatsmart.quickblox.com, user_id=83435042, photo=null, unread_message_count=0, customData=null}
2019-10-02 03:19:59.068 12608-12608/com.smartsco.recaruoperator I/ChatFragment: DIALOG JOIN - FAILED: Client is not, or no longer, connected.
com.quickblox.core.exception.QBResponseException: Client is not, or no longer, connected.
必须在加入(本地检索的)对话之前执行此操作...
qbChatDialog.initForChat(QBChatService.getInstance());
正在尝试从本地保存在房间数据库模型中的对话实例加入对话。它给了我这个错误。但是,当我从服务器获取对话框时工作正常。
public QBChatDialog getDialogFromDialogModel(ChatDialogModel mChatDialogModel) {
QBChatDialog mQBChatDialog = new QBChatDialog();
mQBChatDialog.setRoomJid(mChatDialogModel.getRoomJid());
mQBChatDialog.setRoomJid(mChatDialogModel.getRoomJid());
mQBChatDialog.setDialogId(mChatDialogModel.getDialogId());
mQBChatDialog.setName(mChatDialogModel.getName());
List<Integer> occupants = new ArrayList<>();
String[] arrayoccu = mChatDialogModel.getOccupantsIds().split(",");
occupants.add(Integer.parseInt(arrayoccu[0]));
occupants.add(Integer.parseInt(arrayoccu[1]));
mQBChatDialog.setOccupantsIds(occupants);
mQBChatDialog.setLastMessage(mChatDialogModel.getLastMessage());
mQBChatDialog.setUnreadMessageCount(mChatDialogModel.getUnreadMessageCount());
mQBChatDialog.setUserId(mChatDialogModel.getUserId());
mQBChatDialog.setType(QBDialogType.GROUP);
mQBChatDialog.setLastMessageDateSent(mChatDialogModel.getLastMessageDateSent());
mQBChatDialog.setLastMessageUserId(mChatDialogModel.getLastMessageUserId());
return mQBChatDialog;
}
qbChatDialog = qbChatHelper.getDialogFromDialogModel(dialogModel);
DiscussionHistory discussionHistory = new DiscussionHistory();
discussionHistory.setMaxStanzas(0);
qbChatDialog.join(discussionHistory, dialogJoinedCallback);
I/QBChatDialog: join to QBChatDialog{id=5d93e886424a796de0b87be3, created_at=null, updated_at=null, last_msg_user_id=0, occupants_ids=[83435042, 83435082], last_message=null, last_message_date_sent=0, type=GROUP, name=5d93dad7424a796de0b87b8c, room_jid=75367_5d93e886424a796de0b87be3@muc.chatsmart.quickblox.com, user_id=83435042, photo=null, unread_message_count=0, customData=null} 2019-10-02 03:19:59.068 12608-12608/com.smartsco.recaruoperator I/ChatFragment: DIALOG JOIN - FAILED: Client is not, or no longer, connected. com.quickblox.core.exception.QBResponseException: Client is not, or no longer, connected.
必须在加入(本地检索的)对话之前执行此操作...
qbChatDialog.initForChat(QBChatService.getInstance());