FeatureFlagManager

public protocol FeatureFlagManager : AnyObject, Sendable

Airship feature flag manager

  • Feature flag result cache. This can be used to return a cached result for flag(name:useResultCache:) if the flag fails to resolve or it does not exist.

    Declaration

    Swift

    var resultCache: any FeatureFlagResultCache { get }
  • Feature flag status updates. Possible values are upToDate, stale and outOfDate.

    Declaration

    Swift

    var featureFlagStatusUpdates: AsyncStream<any Sendable> { get async }
  • featureFlagStatus Asynchronous

    Current feature flag status. Possible values are upToDate, stale and outOfDate.

    Declaration

    Swift

    var featureFlagStatus: FeatureFlagUpdateStatus { get async }
  • Tracks a feature flag interaction event.

    Declaration

    Swift

    func trackInteraction(flag: FeatureFlag)

    Parameters

    flag

    The flag.

  • Gets and evaluates a feature flag.

    Throws

    Throws FeatureFlagError if the flag fails to resolve.

    Declaration

    Swift

    func flag(name: String, useResultCache: Bool) async throws -> FeatureFlag

    Return Value

    The feature flag.

  • flag(name:) Asynchronous

    Gets and evaluates a feature flag using a result cache.

    Throws

    Throws FeatureFlagError if the flag fails to resolve.

    Declaration

    Swift

    func flag(name: String) async throws -> FeatureFlag

    Return Value

    The feature flag.

  • waitRefresh() Asynchronous

    Waits for the refresh of the Feature Flag rules.

    Declaration

    Swift

    func waitRefresh() async
  • waitRefresh(maxTime:) Asynchronous

    Waits for the refresh of the Feature Flag rules.

    Declaration

    Swift

    func waitRefresh(maxTime: TimeInterval) async