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 size in MB for the UA Disk Cache. Defaults to 100.

    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.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger cacheDiskSizeInMB;

    Swift

    var cacheDiskSizeInMB: UInt { get set }
  • 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.

    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.

    Note

    See UAWhitelist for pattern entry syntax.

    Declaration

    Objective-C

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

    Swift

    var whitelist: [String] { get set }
  • Toggles Urban Airship analytics. Defaults to YES. If set to NO, many UA 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 Urban 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 Urban 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 Urban Airship landing page content url. This option is reserved for internal debugging.

    Declaration

    Objective-C

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

    Swift

    var landingPageContentURL: String { get set }
  • The Urban 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 Urban 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 }
  • 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, SDK will use WKWebView for UA default inbox message and overlay views. If set to NO, SDK will use UIWebView for UA default inbox message and overlay views.

    Defaults to NO. - note: Will default to YES in SDK 9.0.

    Declaration

    Objective-C

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

    Swift

    var useWKWebView: Bool { get set }
  • The current app key (resolved using the inProduction flag).

    Declaration

    Objective-C

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

    Swift

    var appKey: String? { get }
  • The current app secret (resolved using the inProduction flag).

    Declaration

    Objective-C

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

    Swift

    var appSecret: String? { get }
  • The current log level for the library’s UA_L macros (resolved using the inProduction flag).

    Declaration

    Objective-C

    @property (readonly, nonatomic) UALogLevel logLevel;

    Swift

    var logLevel: UALogLevel { get }
  • 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 }
  • 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.

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