MessagesProvider
public protocol MessagesProvider
The provider for message related properties and methods.
-
Loads additional messages in the specified thread.
Throws
notConnectedif an attempt was made to use a method without connecting first. Make sure you call theconnectmethod first.Throws
noMoreMessagesif there aren’t any other messages, so additional messages could not be loaded.Throws
invalidOldestDateif Thread is missing the timestamp of when the message was created.Throws
customerAssociationFailureif the SDK could not get customer identity and it may not have been set.Throws
invalidDatawhen the Data object cannot be successfully converted to a valid UTF-8 stringThrows
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.“Declaration
Swift
func loadMore(for chatThread: ChatThread) throwsParameters
chatThreadThe thread for which to load more messages.
-
send(_:Asynchronousfor: ) Sends a message in the specified chat thread through CXone chat.
Throws
illegalThreadStateif the chat thread is not in the correct state.Throws
attachmentErrorif the provided attachment was unable to be sent.Throws
notConnectedif an attempt was made to use a method without connecting first. Make sure you call theconnectmethod first.Throws
customerAssociationFailureif the SDK could not get customer identity and it may not have been set.Throws
missingParameter(_:)if attachments uploadurlhas not been set properly or attachment uploaded data object is missing.Throws
serverErrorif the server experienced an internal error and was unable to perform the action.Throws
invalidParameter(_:)if the the outbound message has nopostback, emptytext, and emptyattachments.Throws
CXoneChatError/noSuchFileif an attached file could not be found.Throws
invalidFileSizeif size of the attachment exceeds the allowed sizeThrows
invalidFileTypeif type of the attachment is not included in the allowed file MIME typeThrows
invalidDataif the conversion from object instance to data failed or when the Data object cannot be successfully converted to a valid UTF-8 stringThrows
invalidThreadif the provided thread was invalid, so the action could not be performed.Throws
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Throws
URLError.badServerResponseif the URL Loading system received bad data from the server.Throws
NSErrorobject that indicates why the request failedThrows
An error in the Cocoa domain, if
urlcannot be read.Throws
An error if any value throws an error during encoding.
Declaration
Swift
func send(_ message: OutboundMessage, for chatThread: ChatThread) async throwsParameters
messageThe content of the message.
chatThreadThe thread in which the message is to be sent.
View on GitHub