我正在更新ZDCChat到ChatSDK。我现在正面临一个问题。
每次我来聊天屏幕Chat.accountProvider?.observeAccount
时,这个观察者都会告诉我No Agent Available
。但我可以在浏览器上找到探员。
第二件事是,当我输入一条消息并点击发送,它没有显示在我的聊天屏幕上。
这是密码。这是在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")
}
结束聊天也不起作用,我一直在让会议开始。
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")
}
}
发布于 2020-05-14 15:21:03
如果你们中的任何一个发现了这个问题并陷入了这个问题,那么请与我联系,我们将一起解决这个问题。
所以,经过这么多挣扎。
发现我们不需要这些代码行:
let chatAPIConfiguration = ChatAPIConfiguration()
chatAPIConfiguration.department = "iOS App"
chatAPIConfiguration.visitorInfo = VisitorInfo(name: nameField.text!, email: emailField.text!, phoneNumber: "")
Chat.instance?.configuration = chatAPIConfiguration;
chatConfiguration.preChatFormConfiguration = formConfiguration
在我删除了这段代码之后,这个应用程序就可以正常工作了。我仍然在寻找如何定制UI。
特别感谢@Linyx。谢谢你帮我找到解决方案。
发布于 2020-05-13 20:26:12
我也有同样的问题
请试着评论这一行:
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:
我也有同样的问题,我写信表示支持。他们回答我已经很长时间了,通信已经进行了将近一个星期。
我决定更详细地分析,因为这样的错误可能是什么。
我试着在聊天中发送一张照片--这是聊天赚来的。
但是如果你只写短信,它们就不会被发送。
然后我决定评论关于用户的信息,然后一切都正常,但是在聊天信息中,用户写的东西是看不见的.
发布于 2020-05-19 11:05:41
Saad Ullah,我启用部门在网站上的聊天设置和ios聊天现在工作.你也能检查一下吗?
还原代码中的更改并尝试
https://stackoverflow.com/questions/61709455
复制相似问题