UAirship

@interface UAirship : NSObject

UAirship manages the shared state for all Airship services. [UAirship takeOff:] should be called from within your application delegate’s application:didFinishLaunchingWithOptions: method to initialize the shared instance.

  • The application configuration.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) UARuntimeConfig *_Nonnull config;

    Swift

    var config: UARuntimeConfig { get }
  • The default action registry.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UAActionRegistry *_Nonnull actionRegistry;

    Swift

    var actionRegistry: UAActionRegistry { get }
  • Stores common application metrics such as last open.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UAApplicationMetrics *_Nonnull applicationMetrics;

    Swift

    var applicationMetrics: UAApplicationMetrics { get }
  • This flag is set to YES if the application is set up with the remote-notification background mode

    Declaration

    Objective-C

    @property (readonly, assign, nonatomic)
        BOOL remoteNotificationBackgroundModeEnabled;

    Swift

    var remoteNotificationBackgroundModeEnabled: Bool { get }
  • A user configurable JavaScript delegate.

    NOTE: this delegate is not retained.

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<UAJavaScriptDelegate> jsDelegate;

    Swift

    weak var jsDelegate: UAJavaScriptDelegate? { get set }
  • A user configurable deep link delegate.

    NOTE: this delegate is not retained.

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<UADeepLinkDelegate>
        deepLinkDelegate;

    Swift

    weak var deepLinkDelegate: UADeepLinkDelegate? { get set }
  • 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.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) UAWhitelist *_Nonnull whitelist;

    Swift

    var whitelist: UAWhitelist { get }
  • The channel capture utility.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UAChannelCapture *_Nonnull channelCapture;

    Swift

    var channelCapture: UAChannelCapture { get }
  • Analytics instance.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) UAAnalytics *_Nonnull analytics;

    Swift

    var analytics: UAAnalytics { get }
  • Enables or disables logging. Logging is enabled by default, though the log level must still be set to an appropriate value.

    Declaration

    Objective-C

    + (void)setLogging:(BOOL)enabled;

    Swift

    class func setLogging(_ enabled: Bool)

    Parameters

    enabled

    If YES, console logging is enabled.

  • Sets the log level for the Airship library. The log level defaults to UALogLevelDebug for development apps, and UALogLevelError for production apps (when the inProduction AirshipConfig flag is set to YES). Values set with this method prior to takeOff will be overridden during takeOff.

    Declaration

    Objective-C

    + (void)setLogLevel:(UALogLevel)level;

    Swift

    class func setLogLevel(_ level: UALogLevel)

    Parameters

    level

    The desired UALogLevel value.

  • Enables or disables logging implementation errors with emoji to make it stand out in the console. It is enabled by default, and will be disabled for production applications.

    Declaration

    Objective-C

    + (void)setLoudImpErrorLogging:(BOOL)enabled;

    Swift

    class func setLoudImpErrorLogging(_ enabled: Bool)

    Parameters

    enabled

    If YES, loud implementation error logging is enabled.

  • Initializes UAirship and performs all necessary setup. This creates the shared instance, loads configuration values, initializes the analytics/reporting module and creates a UAUser if one does not already exist.

    This method must be called from your application delegate’s application:didFinishLaunchingWithOptions: method, and it may be called only once.

    Warning

    takeOff: must be called on the main thread. This method will throw an UAirshipTakeOffMainThreadException if it is run on a background thread.

    Declaration

    Objective-C

    + (void)takeOff:(nullable UAConfig *)config;

    Swift

    class func takeOff(_ config: UAConfig?)

    Parameters

    config

    The populated UAConfig to use.

  • Simplified takeOff method that uses AirshipConfig.plist for initialization.

    Declaration

    Objective-C

    + (void)takeOff;

    Swift

    class func takeOff()