UnbluVisitorClient

public protocol UnbluVisitorClient : UnbluClient

A protocol describing functionality of the UnbluVisitorClient. This inherits functionality from UnbluClient.

  • The delegate for Unblu related events

    Declaration

    Swift

    var visitorDelegate: UnbluVisitorClientDelegate? { get set }
  • The UnbluConversationInterceptor for intercepting conversation-related events from Unblu.

    Declaration

    Swift

    var conversationInterceptor: UnbluConversationInterceptor? { get set }
  • Starts a new conversation of the given conversation type. If the UI is already visible, calling #startNewConversation will display the new conversation in the UI.

    This is an asynchronous call. Use the callback to check for success or failure.

    Declaration

    Swift

    func startNewConversation(conversationType: ConversationType, customVisitorData: String?, conversationRecipient: ConversationRecipient?, onComplete: @escaping (Result<UnbluConversation, UnbluInitConversationError>) -> Void)

    Parameters

    conversationType

    The initial type of the new conversation.

    customVisitorData

    Optional String of contextual data to initialize the conversation with. The default value is nil. This custom string is used to add additional information to the Visitor when integrating it with a bot or other external systems.

    conversationRecipient

    The team or agent recipient of the conversation. This will overwrite any named area that might be set for this web page. NOTE: The data which is passed here could be used in UnbluConversationInterceptor

    onComplete

    A Result containing the UnbluConversation that was started, or an UnbluApiInitConversationError if starting a conversation failed.

  • Joins an Unblu mobile co-browsing session started by an agent. This is an asynchronous call. Use the callback to check for success or failure.

    Declaration

    Swift

    func joinConversation(pin: String, onComplete: @escaping (Result<UnbluConversation, UnbluInitConversationError>) -> Void)

    Parameters

    pin

    The pin for the conversation to join. The pin is provided by the Agent Desk.

    onComplete

    A Result containing the UnbluConversation of the conversation with the mobile co-browsing session that the visitor joined, or an UnbluApiInitConversationError if joining the mobile co-browsing session failed.

  • Checks if at least one agent is available for mobile co-browsing or chat.

    This is an asynchronous call. Use the callbacks to check for success or failure.

    Declaration

    Swift

    func isAgentAvailable(onComplete: @escaping (Result<Bool, UnbluClientNotInitializedError>) -> Void)

    Parameters

    onComplete

    A Result reporting success with true or false to indicate whether an agent is available, or an UnbluApiNotInitializedError if checking agent availability failed.