CXoneChatDelegate

public protocol CXoneChatDelegate : AnyObject

The handler for the chat events.

  • onUnexpectedDisconnect() Default implementation

    Callback to be called when the connection unexpectedly drops.

    Default Implementation

    Declaration

    Swift

    func onUnexpectedDisconnect()
  • onChatUpdated(_:mode:) Default implementation

    Callback to be called when the chat state has been updated.

    Default Implementation

    Declaration

    Swift

    func onChatUpdated(_ state: ChatState, mode: ChatMode)

    Parameters

    chatState

    Current state of the chat

    mode

    Mode of the chat based on the channel configuration

  • onThreadUpdated(_:) Default implementation

    Callback to be called when the thread has been updated.

    It can reflect any updated property of the thread – messages, name, assigned agent etc.

    Default Implementation

    Declaration

    Swift

    func onThreadUpdated(_ chatThread: ChatThread)

    Parameters

    chatThread

    The updated chat thread

  • onThreadsUpdated(_:) Default implementation

    Callback to be called when threads have been updated.

    It can reflect any updated property of the thread – messages, name, assigned agent etc.

    Default Implementation

    Declaration

    Swift

    func onThreadsUpdated(_ chatThreads: [ChatThread])

    Parameters

    chatThread

    The updated chat threads

  • onCustomEventMessage(_:) Default implementation

    Callback to be called when a custom message is received.

    Default Implementation

    Declaration

    Swift

    func onCustomEventMessage(_ messageData: Data)

    Parameters

    messageData

    The data of the custom plugin message.

  • onAgentTyping(_:threadId:) Default implementation

    Callback to be called when the agent has stopped typing.

    Default Implementation

    Declaration

    Swift

    func onAgentTyping(_ isTyping: Bool, threadId: UUID)

    Parameters

    isTyping

    An agent has started or ended typing.

    threadId

    The unique identifier of thread where typing state changed.

  • onContactCustomFieldsSet() Default implementation

    Callback to be called when the custom fields are set for a contact.

    Default Implementation

    Declaration

    Swift

    func onContactCustomFieldsSet()
  • onCustomerCustomFieldsSet() Default implementation

    Callback to be called when the custom fields are set for a customer.

    Default Implementation

    Declaration

    Swift

    func onCustomerCustomFieldsSet()
  • onError(_:) Default implementation

    Callback to be called when an error occurs.

    Default Implementation

    Declaration

    Swift

    func onError(_ error: Error)

    Parameters

    error

    The error.

  • onTokenRefreshFailed() Default implementation

    Callback to be called when refreshing the token has failed.

    Default Implementation

    Declaration

    Swift

    func onTokenRefreshFailed()
  • Callback to be called when a custom popup proactive action is received.

    Default Implementation

    Declaration

    Swift

    func onProactivePopupAction(data: [String : Any], actionId: UUID)

    Parameters

    data

    The proactive popup action data

    actionId

    The unique identifier of the action.