MessageDelivering

public protocol MessageDelivering

Protocol used by your MessagingPublisher to get messages from the backend.

  • Channel ID (read-only)

    Declaration

    Swift

    var channelId: String { get }
  • If you need to keep track of the last message id that was returned.

    Declaration

    Swift

    var lastMessageId: String? { get set }
  • Callback handler to call when new messages are available

    Declaration

    Swift

    var onMessages: ((Result<CAIConversationResultData, CAIError>) -> Void)? { get set }
  • Called by the MessagingPublisher when conversationId has been created

    Declaration

    Swift

    func initialize(_ conversationId: String)

    Parameters

    conversationId

    String

  • Called when framework is requesting new messages

    Declaration

    Swift

    func start()
  • Called when framework is no longer requesting new messages

    Declaration

    Swift

    func stop()
  • Called to ensure the connection is opened before posting a message to the backend

    Declaration

    Swift

    func reconnect() -> AnyPublisher<Bool, CAIError>