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
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
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 set(_ customFields: [String : String]) async throwsParameters
customFieldsThe custom fields to be saved.
View on GitHub