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

    invalidThread if the provided ID for the thread was invalid, so the action could not be performed.

    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 threadsService is not correctly registered.

    Throws

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

    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

    eventTimeout if 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.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 trigger(_ action: ProactiveActionTriggerType) async throws

    Parameters

    action

    The proactive action to trigger with its associated data