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 (nonatomic, copy, 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 (nonatomic, copy, 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 (nonatomic, copy, 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 (nonatomic, copy, nullable) NSString *productionAppSecret;
Swift
var productionAppSecret: String? { get set }
-
The log level used for development apps. Defaults to
UALogLevelDebug
(4).Declaration
Objective-C
@property (nonatomic) UALogLevel developmentLogLevel;
Swift
var developmentLogLevel: UALogLevel { get set }
-
The log level used for production apps. Defaults to
UALogLevelError
(1).Declaration
Objective-C
@property (nonatomic) UALogLevel productionLogLevel;
Swift
var productionLogLevel: UALogLevel { get set }
-
Flag indicating whether data collection needs to be opted in with
UAirship.dataCollectionEnabled
. This flag will only take affect on first run. If previously not enabled, the device will still have data collection enabled until disabled withUAirship.dataCollectionEnabled
.Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isDataCollectionOptInEnabled) BOOL dataCollectionOptInEnabled;
Swift
var isDataCollectionOptInEnabled: Bool { get set }
-
The default app key. Depending on the
inProduction
status,developmentAppKey
orproductionAppKey
will take priority.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *defaultAppKey;
Swift
var defaultAppKey: String? { get set }
-
The default app secret. Depending on the
inProduction
status,developmentAppSecret
orproductionAppSecret
will take priority.Declaration
Objective-C
@property (nonatomic, copy, 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 (nonatomic, assign, unsafe_unretained, readwrite, getter=isInProduction) 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 (nonatomic, assign, unsafe_unretained, readwrite, getter=isAutomaticSetupEnabled) BOOL automaticSetupEnabled;
Swift
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
Objective-C
@property (nonatomic, copy) NSArray<NSString *> *_Nonnull URLAllowList;
Swift
var urlAllowList: [String] { get set }
-
An array of UAURLAllowList 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
Objective-C
@property (nonatomic, copy) NSArray<NSString *> *_Nonnull URLAllowListScopeJavaScriptInterface;
Swift
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
Objective-C
@property (nonatomic, copy) NSArray<NSString *> *_Nonnull URLAllowListScopeOpenURL;
Swift
var urlAllowListScopeOpenURL: [String] { get set }
-
The iTunes ID used for Rate App Actions.
Declaration
Objective-C
@property (nonatomic, copy) NSString *_Nonnull itunesID;
Swift
var itunesID: String { get set }
-
Toggles Airship analytics. Defaults to
YES
. If set toNO
, many Airship features will not be available to this application.Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isAnalyticsEnabled) 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 toNO
(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 (nonatomic) BOOL detectProvisioningMode;
Swift
var detectProvisioningMode: Bool { get set }
-
The Airship default message center style configuration file.
Declaration
Objective-C
@property (nonatomic, copy) 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 (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 toNO
.Declaration
Objective-C
@property (nonatomic) BOOL clearNamedUserOnAppRestore;
Swift
var clearNamedUserOnAppRestore: Bool { get set }
-
Flag indicating whether channel capture feature is enabled or not.
Defaults to
NO
.Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isChannelCaptureEnabled) 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 (nonatomic, assign, unsafe_unretained, readwrite, getter=isChannelCreationDelayEnabled) BOOL channelCreationDelayEnabled;
Swift
var isChannelCreationDelayEnabled: Bool { get set }
-
Flag indicating whether extended broadcasts are enabled. If set to
YES
the AirshipReady NSNotification will contain additional data: the channel identifier and the app key.Defaults to
NO
.Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isExtendedBroadcastsEnabled) BOOL extendedBroadcastsEnabled;
Swift
var isExtendedBroadcastsEnabled: Bool { get set }
-
Dictionary of custom config values.
Declaration
Objective-C
@property (nonatomic, copy) 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 (nonatomic) BOOL requestAuthorizationToUseNotifications;
Swift
var requestAuthorizationToUseNotifications: Bool { get set }
-
Creates an instance using the values set in the
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.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.
Declaration
Objective-C
+ (nonnull UAConfig *)config;
Return Value
A UAConfig with empty values.
-
Returns the resolved app key.
Declaration
Objective-C
@property (readonly, nonnull) NSString *appKey;
Swift
var appKey: String { get }
Return Value
The resolved app key or an empty string.
-
Returns the resolved app secret.
Declaration
Objective-C
@property (readonly, nonnull) NSString *appSecret;
Swift
var appSecret: String { get }
Return Value
The resolved app key or an empty string.
-
Returns the resolved log level.
Declaration
Objective-C
@property (readonly) 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.
Declaration
Objective-C
- (BOOL)validate;
Swift
func validate() -> Bool
Return Value
YES
if the current configuration is valid, otherwiseNO
.