gpt4 book ai didi

swift - 在与 Quickblox 的私有(private)聊天中创建对话框问题

转载 作者:行者123 更新时间:2023-11-30 13:18:38 24 4
gpt4 key购买 nike

我正在尝试使用 QuickBlox 实现私有(private) 1 对 1 聊天,但遵循 Quickblox 文档仅显示 http://quickblox.com/developers/Chat#Create_dialog 中的群聊。当我尝试仅发送单个 occupants_ids 时,会出现以下错误:

{
"errors": [
"Occupants_ids cannot be less than one."
]
}

我正在使用以下正文创建对话框 API:

{
"type": 3,
"name": "",
"occupant_id": "13822296"
}

我需要更新请求正文中的某些键吗?

最佳答案

请检查:Create new 1-1(private) chat dialog

代码来自documentaton为我工作:

let chatDialog: QBChatDialog = QBChatDialog(dialogID: nil, type: QBChatDialogType.Private)
chatDialog.occupantIDs = [user.ID]

QBRequest.createDialog(chatDialog, successBlock: {(response: QBResponse?, createdDialog: QBChatDialog?) in completion?(response: response, createdDialog: chatDialog)

print("sucess + \(response)")

}, errorBlock: {(response: QBResponse!) in

print("response + \(response)")
})

关于swift - 在与 Quickblox 的私有(private)聊天中创建对话框问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37983748/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com