BehaviorManager

@objc(SFMCSdkBehaviorManager)
public final class BehaviorManager : NSObject, BehaviorDelegate

This class allows modules to register observers to receive requested behavior event types. Observers must adhere to the BehaviorObserver protocol where the BehaviorManager will notify each observer via their respective onBehavior() function. Behavior types that can be tracked include: (BehaviorType)

  • Tag: BehaviorManager
  • Shared instance of Behavior Manager

    Declaration

    Swift

    public static let shared: BehaviorManager
  • Adds an observer to the manager’s list of observers listening for app behavior events

    Declaration

    Swift

    public func addObserver(_ observer: BehaviorObserver)

    Parameters

    observer

    Object adhearing to the BehaviorObserver protocol

  • Remove an observer from the list of observers listening for app behavior events

    Declaration

    Swift

    public func removeObserver(_ observer: BehaviorObserver)

    Parameters

    observer

    Observer object adhearing to the BehaviorObserver protocol. Removes observer by reference