1对1聊天正在进行,但群聊无效。
创建了一个小组对话:
let chatDialog = QBChatDialog(dialogID: nil, type: QBChatDialogType.group)
let currentUserId = UserDefaults.standard.integer(forKey: "CurrentUserID")
let groupName = "\(groupUsers[0].fullName ?? "" ), \(groupUsers[1].fullName ?? "" )..."
chatDialog.name = groupName
var ids = groupUsers.map { (user2) -> UInt in
return user2.id
}
chatDialog.occupantIDs = ids as [NSNumber]
QBRequest.createDialog(chatDialog, successBlock: { (response: QBResponse?, createdDialog : QBChatDialog?) -> Void in
print(response ?? "", createdDialog ?? "")
print("dialog created")
self.dialogUpdateBlock!()
SVProgressHUD.dismiss()
self.navigationController?.popViewController(animated: true)
}) { (responce : QBResponse!) -> Void in
print(responce, "error")
SVProgressHUD.dismiss()
}
但是,当我发送聊天消息时,在任何一种方法中都没有收到任何占用者的实时信息。
func chatDidReceive(_ message: QBChatMessage) {
print(message) //This is working in one-to-one chat but not working in group chat.
}
func chatRoomDidReceive(_ message: QBChatMessage, fromDialogID dialogID: String) {
print(message)
}