gpt4 book ai didi

ios - 在Zendesk iOS Swift中使用ChatSDK

转载 作者:行者123 更新时间:2023-12-01 19:32:32 29 4
gpt4 key购买 nike

我正在将ZDCChat更新为ChatSDK。我现在正面临一个问题。

每次我进入聊天屏幕Chat.accountProvider?.observeAccount时,此观察者都会告诉我No Agent Available。但是在浏览器中我可以使用代理。

第二件事是当我输入一条消息并点击send时,它没有显示在我的聊天屏幕上。

这是代码。这在AppDelegate中:

 let chatConfiguration = ChatConfiguration()
chatConfiguration.isPreChatFormEnabled = false

let chatAPIConfiguration = ChatAPIConfiguration()
chatAPIConfiguration.department = "Blah"
chatAPIConfiguration.visitorInfo = VisitorInfo(name: "BlahUser", email: "test@test.com", phoneNumber: "")
Chat.instance?.configuration = chatAPIConfiguration;

Chat.initialize(accountKey: "------my key------", queue: .main)

这就是我开始聊天的方式
 let chatAPIConfiguration = ChatAPIConfiguration()
chatAPIConfiguration.department = "iOS App"
chatAPIConfiguration.visitorInfo = VisitorInfo(name: nameField.text!, email: emailField.text!, phoneNumber: "")
Chat.instance?.configuration = chatAPIConfiguration;

do {
let chatEngine = try ChatEngine.engine()
let viewController = try Messaging.instance.buildUI(engines: [chatEngine], configs: [])
viewController.view.backgroundColor = Constants.bgColor
self.navigationController?.pushViewController(viewController, animated: true)
} catch {

// handle error
print("error initaiting chat")
}

结束聊天也不起作用,我一直在开始 session 。
 let stateToken = Chat.chatProvider?.observeChatState { (state) in
// Handle logs, agent events, queue position changes and other events
print("My Session status: ", state.chatSessionStatus)
switch state.chatSessionStatus {
case .configuring:
print("COnfiguring")
case .ended:
print("Ended")
case .ending:
print("Ending")
case .initializing:
print("initializing")
case .started:
print("started")
default:
print("Default Case")
}
}

最佳答案

我也有同样的问题

尝试对此行发表评论:

let chatAPIConfiguration = ChatAPIConfiguration()
chatAPIConfiguration.department = "iOS App"
chatAPIConfiguration.visitorInfo = VisitorInfo(name: nameField.text!, email: emailField.text!, phoneNumber: "")
Chat.instance?.configuration = chatAPIConfiguration;


chatConfiguration.preChatFormConfiguration = formConfiguration


 let chatConfiguration = ChatConfiguration()
chatConfiguration.isPreChatFormEnabled = false

let chatAPIConfiguration = ChatAPIConfiguration()
chatAPIConfiguration.department = "Blah"
chatAPIConfiguration.visitorInfo = VisitorInfo(name: "BlahUser", email: "test@test.com", phoneNumber: "")
Chat.instance?.configuration = chatAPIConfiguration;

UPD:

我有同样的问题,我写了支持书。
他们回答了我很长时间,信件已经进行了近一个星期。

我决定更详细地分析,因为可能是这样的错误。

我试图在聊天中发送图片-聊天获得了。

但是,如果您只写短信,则不会发送。

然后,我决定评论有关用户的信息,然后一切正常,但是在聊天信息中,看不到用户写的内容...

关于ios - 在Zendesk iOS Swift中使用ChatSDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61709455/

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