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
VisitorInfomodel. Defaults toVisitorInfo.initial.Declaration
Swift
@objc public var visitorInfo: VisitorInfo { get } -
Update Visitor Information using
VisitorInfomodel.Declaration
Swift
public func setVisitorInfo(_ visitorInfo: VisitorInfo, completion: ((Result<VisitorInfo, DeliveryStatusError>) -> Void)? = nil)Parameters
visitorInfoVisitorInfomodel containingname,email, andphoneNumber.completionResult<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
visitorPathVisitorPatheventcompletionResult<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
tagsArray of tags to add to the visitor profile.
completionResult<[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
tagsArray of tags to remove from the visitor profile.
completionResult<[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
noteNote to append to the visitor profile.
completionResult<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
noteNote to set on the visitor profile.
completionResult<String, DeliveryStatusError>closure to handle if update sent successfully. Default isnil.
-
Observe changes of the current
VisitorInfoDeclaration
Swift
public func observeVisitorInfo(identifier: ObservableIdentifier = .uuid(), _ completion: @escaping (VisitorInfo) -> Void) -> ObservationTokenParameters
identifierObservableIdentifier to be exclusive, or unique
completionblock that executes everytime there is an update to the
VisitorInfoReturn Value
An
ObservationTokenthat can cancel the subscription to theVisitorInfo.
Install in Dash
ProfileProvider Class Reference