MessagesProvider

public protocol MessagesProvider

The provider for message related properties and methods.

  • Loads additional messages in the specified thread.

    Throws

    notConnected if an attempt was made to use a method without connecting first. Make sure you call the connect method first.

    Throws

    noMoreMessages if there aren’t any other messages, so additional messages could not be loaded.

    Throws

    invalidOldestDate if Thread is missing the timestamp of when the message was created.

    Throws

    customerAssociationFailure if the SDK could not get customer identity and it may not have been set.

    Throws

    EncodingError.invalidValue(_:_:) if the given value is invalid in the current context for this format.“

    Declaration

    Swift

    func loadMore(for chatThread: ChatThread) throws

    Parameters

    chatThread

    The thread for which to load more messages.

  • send(_:for:) Asynchronous

    Sends a message in the specified chat thread through CXone chat.

    Throws

    notConnected if an attempt was made to use a method without connecting first. Make sure you call the connect method first.

    Throws

    illegalThreadState if the chat thread is not in the correct state.

    Throws

    customerAssociationFailure if the SDK could not get customer identity and it may not have been set.

    Throws

    serverError if the server experienced an internal error and was unable to perform the action.

    Throws

    missingParameter(_:) if attachments upload url has not been set properly or attachment uploaded data object is missing.

    Throws

    attachmentError if the provided attachment was unable to be sent.

    Throws

    invalidParameter(_:) if the the outbound message has no postback, empty text, and empty attachments.

    Throws

    EncodingError.invalidValue(_:_:) if the given value is invalid in the current context for this format.

    Throws

    URLError.badServerResponse if the URL Loading system received bad data from the server.

    Throws

    NSError object that indicates why the request failed

    Throws

    An error in the Cocoa domain, if url cannot be read.

    Declaration

    Swift

    func send(_ message: OutboundMessage, for chatThread: ChatThread) async throws

    Parameters

    message

    The content of the message.

    chatThread

    The thread in which the message is to be sent.