我无法向现有对话框发送消息。我已成功登录quickblox并创建了连接用户的实例。会话由ios sdk自动处理(如文档中所述),所以我不关心会话处理。我能够检索对话框的现有消息,但无法向任何对话框发送消息......请帮助我。我发现没办法了!
我的代码是:
@IBAction func sendMessageButton(sender: UIButton) {
QBChat.instance().addDelegate(self)
let privateChatDialog = QBChatDialog(dialogID: self.dialogId, type: QBChatDialogType.Private)
let message = QBChatMessage()
message.text = self.sendMessageTextView.text
let params : NSMutableDictionary = NSMutableDictionary()
params["save_to_history"] = true
message.customParameters = params
privateChatDialog.sendMessage(message) { (error : NSError?) in
print(error)
}
}
输出是:
[ChatService]消息SNT:@ chat.quickblox.com“> Rishi message114673779285773aceda0eb4799f800000e 2016-07-01 18:28:48.238 Catchmates.temp_caseinsensitive_rename [7063:156246] [ChatService] StreamManagement:确实要求确认无2016-07-01 18:28:49.161 Catchmates.temp_caseinsensitive_rename [7063:156246] [ChatService] StreamManagement:确实收到了节的确认 ids数:2