PreferenceCenter
@MainActor
public protocol PreferenceCenter : AnyObject, Sendable
An interface for interacting with Airship’s Preference Center.
-
Called when the Preference Center is requested to be displayed. Return
trueif the display was handled,falseto fall back to default SDK behavior.Declaration
Swift
@MainActor var onDisplay: (@MainActor @Sendable (_ preferenceCenterID: String) -> Bool)? { get set } -
Open delegate for the Preference Center.
Declaration
Swift
@MainActor var openDelegate: (any PreferenceCenterOpenDelegate)? { get set } -
The theme for the Preference Center.
Declaration
Swift
@MainActor var theme: PreferenceCenterTheme? { get set } -
Loads a Preference Center theme from a plist file.
Declaration
Swift
@MainActor func setThemeFromPlist(_ plist: String) throwsParameters
plistThe name of the plist in the bundle.
-
Displays the Preference Center with the given ID.
Declaration
Swift
@MainActor func display(_ preferenceCenterID: String)Parameters
preferenceCenterIDThe preference center ID.
-
Opens the Preference Center with the given ID. (Deprecated)
Declaration
Swift
@available(*, deprecated, renamed: "display(identifier:﹚") @MainActor func open(_ preferenceCenterID: String) -
config(preferenceCenterID:Asynchronous) Returns the configuration of the Preference Center with the given ID.
Declaration
Swift
@MainActor func config(preferenceCenterID: String) async throws -> PreferenceCenterConfigParameters
preferenceCenterIDThe preference center ID.
-
jsonConfig(preferenceCenterID:Asynchronous) Returns the configuration of the Preference Center as JSON data with the given ID.
Declaration
Swift
@MainActor func jsonConfig(preferenceCenterID: String) async throws -> DataParameters
preferenceCenterIDThe preference center ID.
View on GitHub