UAConfig

@interface UAConfig : NSObject <NSCopying>

The UAConfig object provides an interface for passing common configurable values to [UAirship takeOff]. 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 plist keys use the same names as this class’s configuration options. Older, all-caps keys are still supported, but you should migrate your properties file to make use of a number of new options.

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

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *developmentAppKey;

    Swift

    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

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *developmentAppSecret;

    Swift

    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

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *productionAppKey;

    Swift

    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

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *productionAppSecret;

    Swift

    var productionAppSecret: String? { get set }
  • The log level used for development apps. Defaults to UALogLevelDebug (4).

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) UALogLevel developmentLogLevel;

    Swift

    var developmentLogLevel: UALogLevel { get set }
  • The log level used for production apps. Defaults to UALogLevelError (1).

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) UALogLevel productionLogLevel;

    Swift

    var productionLogLevel: UALogLevel { get set }
  • The default app key. Depending on the inProduction status, developmentAppKey or productionAppKey will take priority.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *defaultAppKey;

    Swift

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

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *defaultAppSecret;

    Swift

    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 YES.

    Declaration

    Objective-C

    @property (getter=isInProduction, assign, readwrite, nonatomic)
        BOOL inProduction;

    Swift

    var isInProduction: Bool { 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 YES. 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

    Objective-C

    @property (getter=isAutomaticSetupEnabled, assign, readwrite, nonatomic)
        BOOL automaticSetupEnabled;

    Swift

    var isAutomaticSetupEnabled: Bool { get set }
  • An array of UAWhitelist entry strings. The whitelist used for validating URLs for landing pages, wallet action, open external URL action, deep link action (if delegate is not set), and HTML in-app messages.

    Note

    See UAWhitelist for pattern entry syntax.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) NSArray<NSString *> *_Nonnull whitelist;

    Swift

    var whitelist: [String] { get set }
  • The iTunes ID used for Rate App Actions.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull itunesID;

    Swift

    var itunesID: String { get set }
  • Toggles Airship analytics. Defaults to YES. If set to NO, many Airship features will not be available to this application.

    Declaration

    Objective-C

    @property (getter=isAnalyticsEnabled, assign, readwrite, nonatomic)
        BOOL analyticsEnabled;

    Swift

    var isAnalyticsEnabled: Bool { get set }
  • Apps may be set to self-configure based on the APS-environment set in the embedded.mobileprovision file by using detectProvisioningMode. If detectProvisioningMode is set to YES, the inProduction value will be determined at runtime by reading the provisioning profile. If it is set to NO (the default), the inProduction flag may be set directly or by using the AirshipConfig.plist file.

    When this flag is enabled, the inProduction flag defaults to YES for safety so that the production keys will always be used if the profile cannot be read in a released app. Simulator builds do not include the profile, and the detectProvisioningMode flag does not have any effect in cases where a profile is not present. When a provisioning file is not present, the app will fall back to the inProduction property as set in code or the AirshipConfig.plist file.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL detectProvisioningMode;

    Swift

    var detectProvisioningMode: Bool { get set }
  • The Airship default message center style configuration file.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic)
        NSString *_Nonnull messageCenterStyleConfig;

    Swift

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

    Defaults to NO.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL clearUserOnAppRestore;

    Swift

    var clearUserOnAppRestore: Bool { get set }
  • If set to YES, the application will clear the previous named user ID on a re-install. Defaults to NO.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL clearNamedUserOnAppRestore;

    Swift

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

    Defaults to YES.

    Declaration

    Objective-C

    @property (getter=isChannelCaptureEnabled, assign, readwrite, nonatomic)
        BOOL channelCaptureEnabled;

    Swift

    var isChannelCaptureEnabled: Bool { get set }
  • Enables or disables whitelist checks at the scope UAWhitelistScopeOpenURL. If disabled, all whitelist checks for this scope will be allowed.

    Defaults to NO.

    Declaration

    Objective-C

    @property (getter=isOpenURLWhitelistingEnabled, assign, readwrite, nonatomic)
        BOOL openURLWhitelistingEnabled;

    Swift

    var isOpenURLWhitelistingEnabled: Bool { get set }
  • Flag indicating whether delayed channel creation is enabled. If set to YES channel creation will not occur until channel creation is manually enabled.

    Defaults to NO.

    Declaration

    Objective-C

    @property (getter=isChannelCreationDelayEnabled, assign, readwrite, nonatomic)
        BOOL channelCreationDelayEnabled;

    Swift

    var isChannelCreationDelayEnabled: Bool { get set }
  • Dictionary of custom config values.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSDictionary *_Nonnull customConfig;

    Swift

    var customConfig: [AnyHashable : Any] { get set }
  • If set to ‘YES’, the Airship SDK will request authorization to use notifications from the user. Apps that set this flag to NO are required to request authorization themselves.

    Defaults to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        BOOL requestAuthorizationToUseNotifications;

    Swift

    var requestAuthorizationToUseNotifications: Bool { get set }
  • The Airship device API url. This option is reserved for internal debugging.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull deviceAPIURL;

    Swift

    var deviceAPIURL: String { get set }
  • The Airship analytics API url. This option is reserved for internal debugging.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull analyticsURL;

    Swift

    var analyticsURL: String { get set }
  • The Airship remote data API url. This option is reserved for internal debugging.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull remoteDataAPIURL;

    Swift

    var remoteDataAPIURL: String { get set }
  • Creates an instance using the values set in the AirshipConfig.plist file. - returns: A UAConfig with values from AirshipConfig.plist file.

    Declaration

    Objective-C

    + (nonnull UAConfig *)defaultConfig;

    Swift

    class func `default`() -> UAConfig

    Return Value

    A UAConfig with values from AirshipConfig.plist file.

  • Creates an instance using the values found in the specified .plist file. - parameter: path The path of the specified file. - returns: A UAConfig with values from the specified file.

    Declaration

    Objective-C

    + (nonnull UAConfig *)configWithContentsOfFile:(nonnull NSString *)path;

    Swift

    /*not inherited*/ init(contentsOfFile path: String)

    Parameters

    path

    The path of the specified file.

    Return Value

    A UAConfig with values from the specified file.

  • Creates an instance with empty values. - returns: A UAConfig with empty values.

    Declaration

    Objective-C

    + (nonnull UAConfig *)config;

    Return Value

    A UAConfig with empty values.

  • Returns the resolved app key. - returns: The resolved app key or an empty string.

    Declaration

    Objective-C

    @property (readonly, atomic, nonnull) NSString *appKey;

    Swift

    var appKey: String { get }

    Return Value

    The resolved app key or an empty string.

  • Returns the resolved app secret. - returns: The resolved app key or an empty string.

    Declaration

    Objective-C

    @property (readonly, atomic, nonnull) NSString *appSecret;

    Swift

    var appSecret: String { get }

    Return Value

    The resolved app key or an empty string.

  • Returns the resolved log level. - returns: The resolved log level.

    Declaration

    Objective-C

    @property (readonly, atomic) UALogLevel logLevel;

    Swift

    var logLevel: UALogLevel { get }

    Return Value

    The resolved log level.

  • Validates the current configuration. In addition to performing a strict validation, this method will log warnings and common configuration errors. - returns: YES if the current configuration is valid, otherwise NO.

    Declaration

    Objective-C

    - (BOOL)validate;

    Swift

    func validate() -> Bool

    Return Value

    YES if the current configuration is valid, otherwise NO.