UAirship

@interface UAirship : NSObject

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

  • The application configuration. This is set on takeOff.

    Declaration

    Objective-C

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

    Swift

    var config: UAConfig { get }
  • The shared analytics manager. There are not currently any user-defined events, so this is for internal library use only at this time.

    Declaration

    Objective-C

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

    Swift

    var analytics: UAAnalytics { 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 }
  • The whitelist used for validating webview URLs.

    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 }
  • 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 Urban 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: Any!)

    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()
  • Returns the UAirship instance.

    Declaration

    Objective-C

    + (null_unspecified UAirship *)shared;

    Swift

    class func shared() -> UAirship!

    Return Value

    The UAirship instance.

  • Returns the UAPush instance. Used for configuring and managing push notifications.

    Declaration

    Objective-C

    + (null_unspecified UAPush *)push;

    Swift

    class func push() -> UAPush!

    Return Value

    The UAPush instance.

  • Returns the UAInbox instance. Provides access to the inbox messages.

    Declaration

    Objective-C

    + (null_unspecified UAInbox *)inbox;

    Swift

    class func inbox() -> UAInbox!

    Return Value

    The UAInbox instance.

  • Returns the UAUser instance.

    Declaration

    Objective-C

    + (null_unspecified UAUser *)inboxUser;

    Swift

    class func inboxUser() -> UAUser!

    Return Value

    The UAUser instance.

  • Returns the UAInAppMessaging instance. Used for customizing in-app notifications.

    Declaration

    Objective-C

    + (null_unspecified UAInAppMessaging *)inAppMessaging;

    Swift

    class func inAppMessaging() -> UAInAppMessaging!
  • Returns the UADefaultMessageCenter instance. Used for customizing and displaying the default message center.

    Declaration

    Objective-C

    + (null_unspecified UADefaultMessageCenter *)defaultMessageCenter;

    Swift

    class func defaultMessageCenter() -> UADefaultMessageCenter!
  • Returns the UANamedUser instance.

    Declaration

    Objective-C

    + (null_unspecified UANamedUser *)namedUser;

    Swift

    class func namedUser() -> UANamedUser!
  • Returns the AirshipResources bundle, or nil if the the bundle cannot be located at runtime.

    Declaration

    Objective-C

    + (nullable NSBundle *)resources;

    Swift

    class func resources() -> Bundle?
  • Returns the UALocation instance.

    Declaration

    Objective-C

    + (null_unspecified UALocation *)location;

    Swift

    class func location() -> UALocation!
  • Returns the UAAutomation instance.

    Declaration

    Objective-C

    + (null_unspecified UAAutomation *)automation;

    Swift

    class func automation() -> UAAutomation!