PreferenceCenter
public final class PreferenceCenter : Sendable
Airship PreferenceCenter module.
-
The shared PreferenceCenter instance.
Airship.takeOff
must be called before accessing this instance.Declaration
Swift
@available(*, deprecated, message: "Use Airship.preferenceCenter instead") 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
@MainActor public var openDelegate: (any 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
@MainActor public func open(_ preferenceCenterID: String)
Parameters
preferenceCenterID
The preference center ID.
-
config(preferenceCenterID:
Asynchronous) Returns the configuration of the Preference Center with the given ID.
Declaration
Swift
public func config(preferenceCenterID: String) async throws -> PreferenceCenterConfig
Parameters
preferenceCenterID
The preference center ID.
-
jsonConfig(preferenceCenterID:
Asynchronous) Returns the configuration of the Preference Center as JSON data with the given ID.
Declaration
Swift
public func jsonConfig(preferenceCenterID: String) async throws -> Data
Parameters
preferenceCenterID
The preference center ID.