PreferenceCenter

@objc(UAPreferenceCenter)
public final class PreferenceCenter : NSObject, Sendable

Airship PreferenceCenter module.

  • The shared PreferenceCenter instance. Airship.takeOff must be called before accessing this instance.

    Declaration

    Swift

    @objc
    public static var shared: PreferenceCenter { get }
  • Open delegate.

    If set, the delegate will be called instead of launching the OOTB preference center screen. Must be set on the main actor.

    Declaration

    Swift

    @objc
    @MainActor
    public weak var openDelegate: PreferenceCenterOpenDelegate? { get set }
  • Preference center theme

    Declaration

    Swift

    @MainActor
    public var theme: PreferenceCenterTheme? { get set }
  • Opens the Preference Center with the given ID.

    Declaration

    Swift

    @objc(openPreferenceCenter:)
    @MainActor
    public func open(_ preferenceCenterID: String)

    Parameters

    preferenceCenterID

    The preference center ID.

  • Returns the configuration of the Preference Center with the given ID.

    Declaration

    Swift

    @objc
    public func config(preferenceCenterID: String) async throws -> PreferenceCenterConfig

    Parameters

    preferenceCenterID

    The preference center ID.

  • Returns the configuration of the Preference Center as JSON data with the given ID.

    Declaration

    Swift

    @objc
    public func jsonConfig(preferenceCenterID: String) async throws -> Data

    Parameters

    preferenceCenterID

    The preference center ID.