Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UrbanAirship

The main Airship API.

Hierarchy

  • UrbanAirship

Index

Methods

Static addCustomEvent

  • addCustomEvent(event: CustomEvent): Promise<null | Error>

Static addListener

  • Adds a listener for an Urban Airship event.

    Parameters

    • eventType: EventType

      The event type. Either EventType.NotificationResponse, EventType.PushReceived, EventType.Register, EventType.Registration, EventType.DeepLink, EventType.NotificationOptInStatus, EventType.InboxUpdated, or EventType.ShowInbox.

    • listener: (...args: any[]) => any

      The event listener.

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns Subscription

    A subscription.

Static addTag

  • addTag(tag: string): void

Static associateIdentifier

  • associateIdentifier(key: string, id?: undefined | string): void
  • Associates an identifier for the Connect data stream.

    Parameters

    • key: string

      The identifier's key.

    • Optional id: undefined | string

      The identifier's id, or null/undefined to clear.

    Returns void

Static clearLocale

  • clearLocale(): void

Static clearNotification

  • clearNotification(identifier: string): void
  • Clears a specific notification. Supported on Android and iOS 10+.

    Parameters

    • identifier: string

      The notification identifier. The identifier will be available in the PushReceived event and in the active notification response under the "notificationId" field.

    Returns void

Static clearNotifications

  • clearNotifications(): void

Static deleteInboxMessage

  • deleteInboxMessage(messageId: string): Promise<boolean>

Static disableFeature

  • disableFeature(features: Feature[]): Promise<boolean>

Static dismissMessage

  • dismissMessage(): void

Static dismissMessageCenter

  • dismissMessageCenter(): void

Static displayMessage

  • displayMessage(messageId: string): Promise<boolean>

Static displayMessageCenter

  • displayMessageCenter(): void

Static editChannelAttributes

Static editChannelSubscriptionLists

Static editChannelTagGroups

Static editContactAttributes

Static editContactSubscriptionLists

Static editContactTagGroups

Static editNamedUserAttributes

Static editNamedUserTagGroups

Static editSubscriptionLists

Static enableChannelCreation

  • enableChannelCreation(): void

Static enableFeature

  • enableFeature(features: Feature[]): Promise<boolean>

Static enableUserPushNotifications

  • enableUserPushNotifications(): Promise<boolean>

Static getActiveNotifications

Static getBadgeNumber

  • getBadgeNumber(): Promise<number>

Static getChannelId

  • getChannelId(): Promise<string | null | undefined>

Static getCurrentLocale

  • getCurrentLocale(): Promise<String>

Static getEnabledFeatures

  • getEnabledFeatures(): Promise<Feature[]>

Static getInboxMessages

Static getNamedUser

  • getNamedUser(): Promise<string | null | undefined>

Static getNotificationChannelStatus

  • getNotificationChannelStatus(channel: string): Promise<string>
  • Gets the status of the specified Notification Channel. This method is only supported on Android. iOS will throw an error.

    Parameters

    • channel: string

      The channel's name.

    Returns Promise<string>

    A promise with the result.

Static getNotificationStatus

Static getRegistrationToken

  • getRegistrationToken(): Promise<string | null | undefined>
  • Gets the registration token.

    Returns Promise<string | null | undefined>

    A promise with the result. The registration token might be undefined if registration is currently in progress, if the app is not setup properly for remote notifications, if running on an iOS simulator, or if running on an Android device that has an outdated or missing version of Google Play Services.

Static getSubscriptionLists

Static getTags

  • getTags(): Promise<string[]>

Static getUnreadMessageCount

  • getUnreadMessageCount(): Promise<number>

Static isAnalyticsEnabled

  • isAnalyticsEnabled(): Promise<boolean>

Static isAutobadgeEnabled

  • isAutobadgeEnabled(): Promise<boolean>

Static isFeatureEnabled

  • isFeatureEnabled(features: Feature[]): Promise<boolean>

Static isFlying

  • isFlying(): Promise<boolean>

Static isSystemNotificationsEnabledForApp

  • isSystemNotificationsEnabledForApp(): Promise<boolean>
  • Checks if app notifications are enabled at a system level or not. Its possible to have userNotificationsEnabled but app notifications being disabled if the user opted out of notifications.

    deprecated

    Use getNotificationStatus() instead.

    Returns Promise<boolean>

    A promise with the result.

Static isUserNotificationsEnabled

  • isUserNotificationsEnabled(): Promise<boolean>

Static isUserNotificationsOptedIn

  • isUserNotificationsOptedIn(): Promise<boolean>
  • Checks if app notifications are enabled or not. Its possible to have userNotificationsEnabled but app notifications being disabled if the user opted out of notifications.

    deprecated

    Use getNotificationStatus() instead.

    Returns Promise<boolean>

    A promise with the result.

Static markInboxMessageRead

  • markInboxMessageRead(messageId: string): Promise<boolean>

Static refreshInbox

  • refreshInbox(): Promise<boolean>
  • Forces the inbox to refresh. This is normally not needed as the inbox will automatically refresh on foreground or when a push arrives that's associated with a message.

    return{promise.<boolean>}

    A promise with the result.

    Returns Promise<boolean>

Static removeAllListeners

  • removeAllListeners(eventType: EventType): void
  • Removes all listeners for Urban Airship events.

    Parameters

    • eventType: EventType

      The event type. Either EventType.NotificationResponse, EventType.PushReceived, EventType.Register, EventType.Registration, EventType.DeepLink, EventType.NotificationOptInStatus, EventType.InboxUpdated, or EventType.ShowInbox.

    Returns void

Static removeListener

  • removeListener(eventType: EventType, listener: (...args: any[]) => any): void
  • Removes a listener for an Urban Airship event.

    Parameters

    • eventType: EventType

      The event type. Either EventType.NotificationResponse, EventType.PushReceived, EventType.Register, EventType.Registration, EventType.DeepLink, EventType.NotificationOptInStatus, EventType.InboxUpdated, or EventType.ShowInbox.

    • listener: (...args: any[]) => any

      The event listener. Should be a reference to the function passed into addListener.

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

Static removeTag

  • removeTag(tag: string): void

Static runAction

  • Runs an Urban Airship action.

    Parameters

    • name: string

      The name of the action.

    • Optional value: JsonValue

      The action's value.

    Returns Promise<JsonValue | Error>

    A promise that returns the action result if the action successfully runs, or the Error if the action was unable to be run.

Static setAnalyticsEnabled

  • setAnalyticsEnabled(enabled: boolean): void
  • Enables or disables analytics.

    Disabling analytics will delete any locally stored events and prevent any events from uploading. Features that depend on analytics being enabled may not work properly if it's disabled (reports, region triggers, location segmentation, push to local time).

    Parameters

    • enabled: boolean

      true to enable notifications, false to disable.

    Returns void

Static setAndroidNotificationConfig

Static setAutoLaunchDefaultMessageCenter

  • setAutoLaunchDefaultMessageCenter(enabled: boolean): void
  • Sets the default behavior when the message center is launched from a push notification. If set to false the message center must be manually launched.

    Parameters

    • enabled: boolean

      true to automatically launch the default message center, false to disable.

    Returns void

Static setAutobadgeEnabled

  • setAutobadgeEnabled(enabled: boolean): void

Static setBadgeNumber

  • setBadgeNumber(badgeNumber: number): void

Static setCurrentLocale

  • setCurrentLocale(localeIdentifier: String): void

Static setEnabledFeatures

  • setEnabledFeatures(features: Feature[]): Promise<boolean>
  • Sets the SDK features that will be enabled. The rest of the features will be disabled.

    If all features are disabled the SDK will not make any network requests or collect data.

    note

    All features are enabled by default.

    Parameters

    Returns Promise<boolean>

    A promise that returns true if the enablement was authorized.

Static setForegroundPresentationOptions

Static setInAppAutomationDisplayInterval

  • setInAppAutomationDisplayInterval(seconds: number): void

Static setNamedUser

  • setNamedUser(namedUser: string | null | undefined): void

Static setNotificationOptions

Static setUserNotificationsEnabled

  • setUserNotificationsEnabled(enabled: boolean): void
  • Sets user notifications enabled. The first time user notifications are enabled on iOS, it will prompt the user for notification permissions.

    Parameters

    • enabled: boolean

      true to enable notifications, false to disable.

    Returns void

Static takeOff

  • Calls takeOff. If Airship is already initialized the new config will be applied on next app init.

    Parameters

    Returns Promise<boolean>

    A promise with the result. The result will be true if Airship is initialized, otherwise false.

Static trackScreen

  • trackScreen(screen: string): void

Generated using TypeDoc