CustomerCustomFieldsProvider

public protocol CustomerCustomFieldsProvider : Sendable

The provider for customer chat fields related properties and methods.

  • Returns the customer-scoped custom fields that persist across every thread this customer participates in.

    Declaration

    Swift

    func get() -> [String : String]

    Return Value

    A dictionary keyed by custom-field identifier with the current stored value.

  • set(_:) Asynchronous

    Sets custom fields to be saved for a customer (persists across all threads involving the customer).

    Note

    Can be used to provide additional custom field(s) to the chat.

    Important

    Additional custom field(s) must be defined in the channel configuration. Otherwise, the custom field(s) can cause the chat initialization to fail.

    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

    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 set(_ customFields: [String : String]) async throws

    Parameters

    customFields

    The custom fields to be saved.