ProactiveActionProvider
public protocol ProactiveActionProvider : Sendable
The provider for proactive action related properties and methods.
-
trigger(_:Asynchronous) Triggers a proactive action with the specified action type and associated data.
This method allows you to trigger a proactive action, for example refresh session when an inactivity popup appears, by providing the action type and its associated data.
Throws
invalidThreadif the provided ID for the thread was invalid, so the action could not be performed.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 missingThrows
serverErrorif the server experienced an internal error and was unable to perform the action.Throws
invalidParameter(_:)if the threadsService is not correctly registered.Throws
invalidParameter(_:)if the outbound message has nopostback, emptytext, and emptyattachments.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
eventTimeoutif the SDK did not receive a response within the specified time.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 trigger(_ action: ProactiveActionTriggerType) async throwsParameters
actionThe proactive action to trigger with its associated data
View on GitHub