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 to VisitorInfo.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 containing name, email, and phoneNumber.

    completion

    Result<VisitorInfo, DeliveryStatusError> closure to handle if update sent successfully. Default is nil.

  • 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 event

    completion

    Result<VisitorPath, DeliveryStatusError> closure to handle if update sent successfully. Default is nil.

  • 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 is nil.

  • 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 is nil.

  • 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 is nil.

  • 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 is nil.

Observers