TargetingController

@objc
public final class TargetingController : NSObject

An object that controls the targeting process, i.e. the workflow leading to the display or not of the chat button.

  • The option used to configure the language of the conversation.

    The language influences the targeting process as only respondents speaking the language of the conversation can take care of it.

    Declaration

    Swift

    public var language: SDKLanguageOption
  • The object notified about the targeting process.

    Declaration

    Swift

    @objc
    public weak var delegate: TargetingControllerDelegate?
  • Indicates if the targeting rule that was activated is available, meaning that a respondent associated to the rule is available to answer.

    Declaration

    Swift

    @objc
    public private(set) var isActiveTargetingRuleAvailable: Bool { get set }
  • Activate the specified targeting rule.

    When you activate a targeting rule, it allows the iAdvize SDK to target the visitor. If one of the respondents associated with the targeting rule is available, the chat button will be displayed so the visitor can start a conversation.

    You can retrieve your targeting rule IDs in the “Engagement” section in the iAdvize administration.

    Declaration

    Swift

    @objc
    public func activateTargetingRule(targetingRule: TargetingRule)

    Parameters

    targetingRuleId

    The ID of the targeting rule to activate.

  • Register the visitor navigation through the app.

    You should call this method each time the visitor navigates to another screen. The iAdvize SDK uses this information to compute stats.

    Declaration

    Swift

    public func registerUserNavigation(navigationOption: NavigationOption = .clearActiveRule)