ContactCustomFieldsProvider
public protocol ContactCustomFieldsProvider : Sendable
The provider for chat fields related properties and methods.
-
Custom fields for current chat case.
Declaration
Swift
func get(for threadId: String) -> [String : String]Parameters
threadIdThe unique identifier of the thread for the custom fields.
Return Value
Dictionary of custom fields for current chat case.
-
set(_:Asynchronousfor: ) Sets custom fields to be saved on a contact (specific thread).
This method sets custom field(s) for a specific thread.
Note
Can be used to provide additional custom field(s) to the chat thread that are not part of the pre-chat survey.
Important
Additional custom field(s) must be defined in the channel configuration. Otherwise, the custom field(s) will cause the conversation 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], for threadId: String) async throwsParameters
customFieldsThe custom fields to be saved.
threadIdThe unique identifier of the thread for the custom fields.
View on GitHub