首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用ChatSDK与Zendesk iOS Swift

使用ChatSDK与Zendesk iOS Swift
EN

Stack Overflow用户
提问于 2020-05-10 09:00:12
回答 3查看 916关注 0票数 2

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

每次我来聊天屏幕Chat.accountProvider?.observeAccount时,这个观察者都会告诉我No Agent Available。但我可以在浏览器上找到探员。

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

这是密码。这是在AppDelegate中的:

代码语言:javascript
运行
复制
 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)

我就是这样开始聊天的

代码语言:javascript
运行
复制
 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")
    }

结束聊天也不起作用,我一直在让会议开始。

代码语言:javascript
运行
复制
 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")
        }
    }
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2020-05-14 15:21:03

如果你们中的任何一个发现了这个问题并陷入了这个问题,那么请与我联系,我们将一起解决这个问题。

所以,经过这么多挣扎。

发现我们不需要这些代码行:

代码语言:javascript
运行
复制
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。谢谢你帮我找到解决方案。

票数 1
EN

Stack Overflow用户

发布于 2020-05-13 20:26:12

我也有同样的问题

请试着评论这一行:

代码语言:javascript
运行
复制
let chatAPIConfiguration = ChatAPIConfiguration()
    chatAPIConfiguration.department = "iOS App"
    chatAPIConfiguration.visitorInfo = VisitorInfo(name: nameField.text!, email: emailField.text!, phoneNumber: "")
    Chat.instance?.configuration = chatAPIConfiguration;

代码语言:javascript
运行
复制
chatConfiguration.preChatFormConfiguration = formConfiguration

代码语言:javascript
运行
复制
 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:

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

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

我试着在聊天中发送一张照片--这是聊天赚来的。

但是如果你只写短信,它们就不会被发送。

然后我决定评论关于用户的信息,然后一切都正常,但是在聊天信息中,用户写的东西是看不见的.

票数 2
EN

Stack Overflow用户

发布于 2020-05-19 11:05:41

Saad Ullah,我启用部门在网站上的聊天设置和ios聊天现在工作.你也能检查一下吗?

还原代码中的更改并尝试

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61709455

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档