ProfileProvider
@objc(ZDKProfileProvider)
public final class ProfileProvider : NSObject
The ZDKProfileProvider
contain APIs to update information about a visitor.
Such as name, email, phone number, tags, and notes related to the visitor and their session.
-
Current
VisitorInfo
model. Defaults toVisitorInfo.initial
.Declaration
Swift
@objc public var visitorInfo: VisitorInfo { get }
-
Update Visitor Information using
VisitorInfo
model.Declaration
Swift
public func setVisitorInfo(_ visitorInfo: VisitorInfo, completion: ((Result<VisitorInfo, DeliveryStatusError>) -> Void)? = nil)
Parameters
visitorInfo
VisitorInfo
model containingname
,email
, andphoneNumber
.completion
Result<VisitorInfo, DeliveryStatusError>
closure to handle if update sent successfully. Default isnil
. -
Send information about user events to the Zendesk Chat agent dashboard.
While chat is uninitialized, events will be buffered and sent to the server once the app is connected to the chat.
Declaration
Swift
public func trackVisitorPath(_ visitorPath: VisitorPath, completion: ((Result<VisitorPath, DeliveryStatusError>) -> Void)? = nil)
Parameters
visitorPath
VisitorPath
eventcompletion
Result<VisitorPath, DeliveryStatusError>
closure to handle if update sent successfully. Default isnil
. -
Add a list of tags to the visitor profile.
Declaration
Swift
public func addTags(_ tags: [String], completion: ((Result<[String], DeliveryStatusError>) -> Void)? = nil)
Parameters
tags
Array of tags to add to the visitor profile.
completion
Result<[String], DeliveryStatusError>
closure to handle if update sent successfully. Default isnil
. -
Remove a list of tags from the
Declaration
Swift
public func removeTags(_ tags: [String], completion: ((Result<[String], DeliveryStatusError>) -> Void)? = nil)
Parameters
tags
Array of tags to remove from the visitor profile.
completion
Result<[String], DeliveryStatusError>
closure to handle if update sent successfully. Default isnil
. -
Append notes to the visitor profile.
Declaration
Swift
public func appendNote(_ note: String, completion: ((Result<String, DeliveryStatusError>) -> Void)? = nil)
Parameters
note
Note to append to the visitor profile.
completion
Result<String, DeliveryStatusError>
closure to handle if update sent successfully. Default isnil
. -
Set visitor note, this will overwrite previous notes
Declaration
Swift
public func setNote(_ note: String, completion: ((Result<String, DeliveryStatusError>) -> Void)? = nil)
Parameters
note
Note to set on the visitor profile.
completion
Result<String, DeliveryStatusError>
closure to handle if update sent successfully. Default isnil
.
-
Observe changes of the current
VisitorInfo
Declaration
Swift
public func observeVisitorInfo(identifier: ObservableIdentifier = .uuid(), _ completion: @escaping (VisitorInfo) -> Void) -> ObservationToken
Parameters
identifier
ObservableIdentifier to be exclusive, or unique
completion
block that executes everytime there is an update to the
VisitorInfo
Return Value
An
ObservationToken
that can cancel the subscription to theVisitorInfo
.