UAConfig

@objc
public class UAConfig : NSObject

The Config object provides an interface for passing common configurable values to UAirship. The simplest way to use this class is to add an AirshipConfig.plist file in your app’s bundle and set the desired options.

  • The development app key. This should match the application on go.urbanairship.com that is configured with your development push certificate.

    Declaration

    Swift

    @objc
    public var developmentAppKey: String? { get set }
  • The development app secret. This should match the application on go.urbanairship.com that is configured with your development push certificate.

    Declaration

    Swift

    @objc
    public var developmentAppSecret: String? { get set }
  • The production app key. This should match the application on go.urbanairship.com that is configured with your production push certificate. This is used for App Store, Ad-Hoc and Enterprise app configurations.

    Declaration

    Swift

    @objc
    public var productionAppKey: String? { get set }
  • The production app secret. This should match the application on go.urbanairship.com that is configured with your production push certificate. This is used for App Store, Ad-Hoc and Enterprise app configurations.

    Declaration

    Swift

    @objc
    public var productionAppSecret: String? { get set }
  • The log level used for development apps. Defaults to debug.

    Declaration

    Swift

    @objc
    public var developmentLogLevel: UAAirshipLogLevel { get set }
  • The log level used for production apps. Defaults to error.

    Declaration

    Swift

    @objc
    public var productionLogLevel: UAAirshipLogLevel { get set }
  • Auto pause InAppAutomation on launch. Defaults to false

    Declaration

    Swift

    @objc
    public var autoPauseInAppAutomationOnLaunch: Bool { get set }
  • The airship cloud site. Defaults to us.

    Declaration

    Swift

    @objc
    public var site: UACloudSite { get set }
  • The default app key. Depending on the inProduction status, developmentAppKey or productionAppKey will take priority.

    Declaration

    Swift

    @objc
    public var defaultAppKey: String? { get set }
  • The default app secret. Depending on the inProduction status, developmentAppSecret or productionAppSecret will take priority.

    Declaration

    Swift

    @objc
    public var defaultAppSecret: String? { get set }
  • The production status of this application. This may be set directly, or it may be determined automatically if the detectProvisioningMode flag is set to true. If neither inProduction nor detectProvisioningMode is set, detectProvisioningMode will be enabled.

    Declaration

    Swift

    @objc
    public var inProduction: NSNumber? { get set }
  • 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.

    Defaults to true. If this is disabled, you will need to register for remote notifications in application:didFinishLaunchingWithOptions: and forward all notification-related app delegate calls to UAPush and UAInbox.

    Declaration

    Swift

    @objc
    public var isAutomaticSetupEnabled: Bool { get set }
  • 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

    @objc(URLAllowList)
    public var urlAllowList: [String]? { get set }
  • 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

    @objc(URLAllowListScopeJavaScriptInterface)
    public var urlAllowListScopeJavaScriptInterface: [String]? { get set }
  • 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

    @objc(URLAllowListScopeOpenURL)
    public var urlAllowListScopeOpenURL: [String]? { get set }
  • The iTunes ID used for Rate App Actions.

    Declaration

    Swift

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

    Declaration

    Swift

    @objc
    public var isAnalyticsEnabled: Bool { get set }
  • The Airship default message center style configuration file.

    Declaration

    Swift

    @objc
    public var messageCenterStyleConfig: String? { get set }
  • 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

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

    Declaration

    Swift

    @objc
    public var clearNamedUserOnAppRestore: Bool { get set }
  • Flag indicating whether channel capture feature is enabled or not.

    Defaults to true.

    Declaration

    Swift

    @objc
    public var isChannelCaptureEnabled: Bool { get set }
  • 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

    @objc
    public var isChannelCreationDelayEnabled: Bool { get set }
  • 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

    @objc
    public var isExtendedBroadcastsEnabled: Bool { get set }
  • If set to ‘YES’, 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

    @objc
    public var requestAuthorizationToUseNotifications: Bool { get set }
  • 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

    @objc
    public var requireInitialRemoteConfigEnabled: Bool { get set }
  • 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

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

    Defaults to false.

    Declaration

    Swift

    @objc
    public var useUserPreferredLocale: Bool { get set }
  • Creates an instance using the values set in the AirshipConfig.plist file.

    Declaration

    Swift

    @objc(defaultConfigWithError:)
    public class func `default`() throws -> UAConfig

    Return Value

    A config with values from AirshipConfig.plist file.

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

    Declaration

    Swift

    @objc
    public class func fromPlist(contentsOfFile path: String) throws -> UAConfig

    Parameters

    path

    The path of the specified file.

    Return Value

    A config with values from the specified file.

  • Creates an instance with empty values.

    Declaration

    Swift

    @objc
    public class func config() -> UAConfig

    Return Value

    A config with empty values.

  • Validates credentails

    Declaration

    Swift

    @objc
    public func validateCredentials(inProduction: Bool) throws

    Parameters

    inProduction

    To validate production or development credentials