ConversationControllerDelegate

@objc
public protocol ConversationControllerDelegate

An object that is notified about the ongoing conversation.

  • Called each time a visitor is entering in a new or existing ongoing conversation.

    Declaration

    Swift

    @objc
    func ongoingConversationUpdated(ongoingConversation: OngoingConversation?)
  • Called when a new incoming message has been received.

    Text content of the message is available if you want to display it in your custom chat button view for example.

    Declaration

    Swift

    @objc
    optional func didReceiveNewMessage(content: String)

    Parameters

    content

    Text content of the message.

  • Called on the delegate when the user has tapped on a link to ask whether the URL should be opened.

    Implementation of this method is optional. By default, the iAdvize SDK opens the URL in a SFSafariViewController.

    Declaration

    Swift

    @objc
    optional func conversationController(_ controller: ConversationController, shouldOpen url: URL) -> Bool

    Parameters

    controller

    The object managing the conversation.

    url

    The URL to be processed.

    Return Value

    true if the URL should be opened; false if you want to handle the URL yourself.