AirshipConfig

public struct AirshipConfig : Decodable, Sendable

The Config object provides an interface for passing common configurable values to Airship.

  • The default app key. Used as the default value for developmentAppKey or productionAppKey.

    Declaration

    Swift

    public var defaultAppKey: String?
  • The default app secret. Used as the default value for developmentAppSecret or productionAppSecret.

    Declaration

    Swift

    public var defaultAppSecret: String?
  • The app key used when inProduction is false.

    The development credentails are generally used to point to a Test Airship project which will send to the development APNS sandbox.

    Declaration

    Swift

    public var developmentAppKey: String?
  • The app secret used when inProduction is false.

    Declaration

    Swift

    public var developmentAppSecret: String?
  • The log level used when inProduction is false.

    Declaration

    Swift

    public var developmentLogLevel: AirshipLogLevel
  • The log privacy level used when inProduction is false. Allows logging to public console. Defaults to private.

    Declaration

    Swift

    public var developmentLogPrivacyLevel: AirshipLogPrivacyLevel
  • The app key used when inProduction is true.

    The production credentails are generally used to point to a Live Airship project which will send to the production APNS sandbox.

    Declaration

    Swift

    public var productionAppKey: String?
  • The app secret used when inProduction is true.

    Declaration

    Swift

    public var productionAppSecret: String?
  • The log privacy level used when inProduction is true. Allows logging to public console. Defaults to error.

    Declaration

    Swift

    public var productionLogLevel: AirshipLogLevel
  • The log privacy level used when inProduction is true. Allows logging to public console. Only used by the default log handler. Defaults to private.

    Declaration

    Swift

    public var productionLogPrivacyLevel: AirshipLogPrivacyLevel
  • Custom log handler to be used instead of the default Airship log handler.

    Declaration

    Swift

    public var logHandler: (any AirshipLogHandler)?
  • Auto pause InAppAutomation on launch. Defaults to false

    Declaration

    Swift

    public var autoPauseInAppAutomationOnLaunch: Bool
  • Flag to enable or disable web view inspection on Airship created web views. Applies only to iOS 16.4+. Defaults to false

    Declaration

    Swift

    public var isWebViewInspectionEnabled: Bool
  • Optional closure for auth challenge certificate validation.

    Declaration

    Swift

    public var connectionChallengeResolver: ChallengeResolveClosure?
  • A closure that can be used to manually recover the channel ID instead of having Airship recover or generate an ID automatically.

    This is a delicate API that should only be used if the application can ensure the channel ID was previously created and by recovering it will only be used by a single device. Having multiple devices with the same channel ID will cause unpredictable behavior.

    When the method is set to restore, the user must provide a previously generated, unique If the closure throws an error, Airship will delay channel registration until a successful execution.

    Declaration

    Swift

    public var restoreChannelID: AirshipChannelCreateOptionClosure?
  • The airship cloud site. Defaults to us.

    Declaration

    Swift

    public var site: CloudSite
  • Default enabled Airship features for the app. For more details, see PrivacyManager. Defaults to all.

    Declaration

    Swift

    public var enabledFeatures: AirshipFeature
  • Allows resetting enabled features to match the runtime config defaults on each takeOff Defaults to false

    Declaration

    Swift

    public var resetEnabledFeatures: Bool
  • Used to select between the either production (true) or development (false) credentails and logging.

    If not set, Airship will pick the credentials based on the APNS sandbox by inspecting the profile on the device. If Airship fails to resolve the APNS environment inProduction will default to true.

    Declaration

    Swift

    public var inProduction: Bool?
  • If enabled, the Airship library automatically registers for remote notifications when push is enabled and intercepts incoming notifications in both the foreground and upon launch.

    If disabled, the app needs to forward methods to Airship. See https://docs.airship.com/platform/mobile/setup/sdk/ios/#automatic-integration for more details.

    Defaults to true.

    Declaration

    Swift

    public var isAutomaticSetupEnabled: Bool
  • An array of UAURLAllowList entry strings. This url allow list is used for validating which URLs can be opened or load the JavaScript native bridge. It affects landing pages, the open external URL and wallet actions, deep link actions (if a delegate is not set), and HTML in-app messages.

    Note

    See UAURLAllowList for pattern entry syntax.

    Declaration

    Swift

    public var urlAllowList: [String]?
  • An array ofUAURLAllowList entry strings. This url allow list is used for validating which URLs can load the JavaScript native bridge, It affects Landing Pages, Message Center and HTML In-App Messages.

    Note

    See UAURLAllowList for pattern entry syntax.

    Declaration

    Swift

    public var urlAllowListScopeJavaScriptInterface: [String]?
  • An array of UAURLAllowList entry strings. This url allow list is used for validating which URLs can be opened. It affects landing pages, the open external URL and wallet actions, deep link actions (if a delegate is not set), and HTML in-app messages.

    Note

    See UAURLAllowList for pattern entry syntax.

    Declaration

    Swift

    public var urlAllowListScopeOpenURL: [String]?
  • The iTunes ID used for Rate App Actions.

    Declaration

    Swift

    public var itunesID: String?
  • Toggles Airship analytics. Defaults to true. If set to false, many Airship features will not be available to this application.

    Declaration

    Swift

    public var isAnalyticsEnabled: Bool
  • The Airship default message center style configuration file.

    Declaration

    Swift

    public var messageCenterStyleConfig: String?
  • If set to true, the Airship user will be cleared if the application is restored on a different device from an encrypted backup.

    Defaults to false.

    Declaration

    Swift

    public var clearUserOnAppRestore: Bool
  • If set to true, the application will clear the previous named user ID on a re-install. Defaults to false.

    Declaration

    Swift

    public var clearNamedUserOnAppRestore: Bool
  • Flag indicating whether channel capture feature is enabled or not.

    Defaults to true.

    Declaration

    Swift

    public var isChannelCaptureEnabled: Bool
  • Flag indicating whether delayed channel creation is enabled. If set to true channel creation will not occur until channel creation is manually enabled.

    Defaults to false.

    Declaration

    Swift

    public var isChannelCreationDelayEnabled: Bool
  • Flag indicating whether extended broadcasts are enabled. If set to true the AirshipReady NSNotification will contain additional data: the channel identifier and the app key.

    Defaults to false.

    Declaration

    Swift

    public var isExtendedBroadcastsEnabled: Bool
  • If set to true, the Airship SDK will request authorization to use notifications from the user. Apps that set this flag to false are required to request authorization themselves.

    Defaults to true.

    Declaration

    Swift

    public var requestAuthorizationToUseNotifications: Bool
  • If set to true, the SDK will wait for an initial remote config instead of falling back on default API URLs.

    Defaults to true.

    Declaration

    Swift

    public var requireInitialRemoteConfigEnabled: Bool
  • The Airship URL used to pull the initial config. This should only be set if you are using custom domains that forward to Airship.

    Declaration

    Swift

    public var initialConfigURL: String?
  • If set to true, the SDK will use the preferred locale. Otherwise it will use the current locale.

    Defaults to false.

    Declaration

    Swift

    public var useUserPreferredLocale: Bool
  • If set to true, Message Center will attempt to be restored between reinstalls. If false, the Message Center user will be reset and the Channel will not be able to use the user as an identity hint to recover the past Channel ID.

    Defaults to true.

    Declaration

    Swift

    public var restoreMessageCenterOnReinstall: Bool
  • Creates an instance with empty values.

    Declaration

    Swift

    public init()

    Return Value

    A config with empty values.

  • Creates an instance using the values set in the AirshipConfig.plist file.

    Declaration

    Swift

    public static func `default`() throws -> AirshipConfig

    Return Value

    A config with values from AirshipConfig.plist file.

  • Creates an instance using the values found in the specified .plist file.

    Declaration

    Swift

    public init(fromPlist path: String) throws

    Parameters

    fromPlist

    The path of the specified plist file.

    Return Value

    A config with values from the specified file.

  • Declaration

    Swift

    public init(from decoder: any Decoder) throws
  • Validates credentails

    Declaration

    Swift

    public func validateCredentials(inProduction: Bool) throws

    Parameters

    inProduction

    To validate production or development credentials