Inherits from NSObject
Declared in UAConfig.h

Overview

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 the properties on this class. Older, all-caps keys are still supported, but you should migrate your properties file to make use of a number of new options.

Properties

analyticsEnabled

Toggles Urban Airship analytics. Defaults to YES. If set to NO, many UA features will not be available to this application.

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

Declared In

UAConfig.h

analyticsURL

The Urban Airship analytics API url. This option is reserved for internal debugging.

@property (nonatomic, copy) NSString *analyticsURL

Declared In

UAConfig.h

appKey

The current app key (resolved using the inProduction flag).

@property (nonatomic, readonly, nullable) NSString *appKey

Declared In

UAConfig.h

appSecret

The current app secret (resolved using the inProduction flag).

@property (nonatomic, readonly, nullable) NSString *appSecret

Declared In

UAConfig.h

automaticSetupEnabled

If enabled, the UA library automatically registers for remote notifications when push is enabled and intercepts incoming notifications in both the foreground and upon launch.

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

Discussion

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.

Declared In

UAConfig.h

cacheDiskSizeInMB

The size in MB for the UA Disk Cache. Defaults to 100.

@property (nonatomic, assign) NSUInteger cacheDiskSizeInMB

Discussion

Only items that are small enough (1/20th of the size) of the cache will be cached.

Any size greater than 0 will cause the UA Disk Cache to become active. UAURLProtocol will be registered as a NSURLProtocol. Only requests whose mainDocumentURL or URL that have been added as a cachable URL will be considered for caching. By defualt it includes all of the Rich Application Page URLs.

Declared In

UAConfig.h

channelCaptureEnabled

Flag indicating whether channel capture feature is enabled or not.

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

Discussion

Defaults to YES.

Declared In

UAConfig.h

channelCreationDelayEnabled

Flag indicating whether delayed channel creation is enabled. If set to YES channel creation will not occur until channel creation is manually enabled.

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

Discussion

Defaults to NO.

Declared In

UAConfig.h

clearNamedUserOnAppRestore

If set to YES, the application will clear the previous named user ID on a re-install. Defaults to NO.

@property (nonatomic, assign) BOOL clearNamedUserOnAppRestore

Declared In

UAConfig.h

clearUserOnAppRestore

If set to YES, the Urban Airship user will be cleared if the application is restored on a different device from an encrypted backup.

@property (nonatomic, assign) BOOL clearUserOnAppRestore

Discussion

Defaults to NO.

Declared In

UAConfig.h

customConfig

Dictionary of custom config values.

@property (nonatomic, copy) NSDictionary *customConfig

Declared In

UAConfig.h

detectProvisioningMode

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.

@property (nonatomic, assign) BOOL detectProvisioningMode

Discussion

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.

Declared In

UAConfig.h

developmentAppKey

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

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

Declared In

UAConfig.h

developmentAppSecret

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

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

Declared In

UAConfig.h

developmentLogLevel

The log level used for development apps. Defaults to UALogLevelDebug (4).

@property (nonatomic, assign) UALogLevel developmentLogLevel

Declared In

UAConfig.h

deviceAPIURL

The Urban Airship device API url. This option is reserved for internal debugging.

@property (nonatomic, copy) NSString *deviceAPIURL

Declared In

UAConfig.h

inProduction

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.

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

Declared In

UAConfig.h

landingPageContentURL

The Urban Airship landing page content url. This option is reserved for internal debugging.

@property (nonatomic, copy) NSString *landingPageContentURL

Declared In

UAConfig.h

logLevel

The current log level for the library’s UA_L macros (resolved using the inProduction flag).

@property (nonatomic, readonly) UALogLevel logLevel

Declared In

UAConfig.h

productionAppKey

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.

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

Declared In

UAConfig.h

productionAppSecret

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.

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

Declared In

UAConfig.h

productionLogLevel

The log level used for production apps. Defaults to UALogLevelError (1).

@property (nonatomic, assign) UALogLevel productionLogLevel

Declared In

UAConfig.h

whitelist

An array of UAWhitelist entry strings.

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

Discussion

Note: See UAWhitelist for pattern entry syntax.

Declared In

UAConfig.h

Class Methods

config

Creates an instance with empty values.

+ (UAConfig *)config

Return Value

A UAConfig with empty values.

Declared In

UAConfig.h

configWithContentsOfFile:

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

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

Parameters

path

The path of the specified file.

Return Value

A UAConfig with values from the specified file.

Declared In

UAConfig.h

defaultConfig

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

+ (UAConfig *)defaultConfig

Return Value

A UAConfig with values from AirshipConfig.plist file.

Declared In

UAConfig.h

Instance Methods

validate

Validates the current configuration. In addition to performing a strict validation, this method will log warnings and common configuration errors.

- (BOOL)validate

Return Value

YES if the current configuration is valid, otherwise NO.

Declared In

UAConfig.h