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

    invalidData when the Data object cannot be successfully converted to a valid UTF-8 string

    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

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

    Throws

    attachmentError if the provided attachment was unable to be sent.

    Throws

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

    Throws

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

    Throws

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

    Throws

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

    Throws

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

    Throws

    CXoneChatError/noSuchFile if an attached file could not be found.

    Throws

    invalidFileSize if size of the attachment exceeds the allowed size

    Throws

    invalidFileType if type of the attachment is not included in the allowed file MIME type

    Throws

    invalidData if the conversion from object instance to data failed or when the Data object cannot be successfully converted to a valid UTF-8 string

    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.

    Throws

    An error if any value throws an error during encoding.

    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.