UrbanAirship

Members

(static, readonly) notificationType :number

Enum for notification types.
Properties:
Name Type Description
none number
badge number
sound number
alert number
Source:
Type:
  • number

(static, readonly) presentationOptions :number

Enum for presentation options.
Properties:
Name Type Description
none number
badge number
sound number
alert number
Source:
Type:
  • number

(static) reattach

Re-attaches document event listeners in this webview
Source:

Methods

(static) addCustomEvent(event, successopt, failureopt)

Adds a custom event.
Source:
Parameters:
Name Type Attributes Description
event object The custom event object.
Name Type Attributes Description
name string The event's name.
value number <optional>
The event's value.
transactionId string <optional>
The event's transaction ID.
properties object <optional>
The event's properties. Only numbers, booleans, strings, and array of strings are supported.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) clearLocale(successopt, failureopt)

Resets the current locale.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) clearNotification(identifier, successopt, failureopt)

Clears a notification by identifier.
Source:
Parameters:
Name Type Attributes Description
identifier string The notification identifier.
success function <optional>
Success callback.
failure function <optional>
Failure callback.

(static) clearNotifications(successopt, failureopt)

Clears all notifications posted by the application.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) deleteInboxMessage(messageId, successopt, failureopt)

Deletes an inbox message.
Source:
Parameters:
Name Type Attributes Description
messageId String The ID of the message to delete.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) disableFeature(features, successopt, failureopt)

Disables features, removing them from the set of currently enabled features.
Source:
Parameters:
Name Type Attributes Description
features array.<string> The features to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) dismissInboxMessage(successopt, failureopt)

Dismiss the inbox message.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) dismissMessageCenter(successopt, failureopt)

Dismiss the message center.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) displayInboxMessage(messageId, successopt, failureopt)

Displays the inbox message using a full screen view.
Source:
Parameters:
Name Type Attributes Description
messageId String The ID of the message to display.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) displayMessageCenter(successopt, failureopt)

Displays the message center.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) editChannelAttributes() → {AttributesEditor}

Creates an editor to modify the channel attributes.
Source:
Returns:
Type:
AttributesEditor
An attributes editor instance.

(static) editChannelSubscriptionLists() → {ChannelSubscriptionListEditor}

Creates an editor to modify the channel subscription lists.
Source:
Returns:
Type:
ChannelSubscriptionListEditor
A subscription list editor instance.

(static) editChannelTagGroups() → {TagGroupEditor}

Creates an editor to modify the channel tag groups.
Source:
Returns:
Type:
TagGroupEditor
A tag group editor instance.

(static) editContactSubscriptionLists() → {ContacttSubscriptionListEditor}

Creates an editor to modify the contact subscription lists.
Source:
Returns:
Type:
ContacttSubscriptionListEditor
A subscription list editor instance.

(static) editNamedUserAttributes() → {AttributesEditor}

Creates an editor to modify the named user attributes.
Source:
Returns:
Type:
AttributesEditor
An attributes editor instance.

(static) editNamedUserTagGroups() → {TagGroupEditor}

Creates an editor to modify the named user tag groups.
Source:
Returns:
Type:
TagGroupEditor
A tag group editor instance.

(static) enableFeature(features, successopt, failureopt)

Enables features, adding them to the set of currently enabled features.
Source:
Parameters:
Name Type Attributes Description
features array.<string> The features to enable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) enableUserNotifications(success, failureopt)

Enables user notifications.
Source:
Parameters:
Name Type Attributes Description
success function Success callback.
Name Type Description
enabled boolean Flag indicating if user notifications enablement was authorized or not.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) getActiveNotifications(successopt, failureopt)

Gets currently active notifications. Note: On Android this functionality is only supported on Android M or higher.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.

(static) getAlias(success, failureopt)

Returns the alias.
Deprecated:
  • Deprecated since 6.7.0 - to be removed in a future version of the plugin - please use getNamedUser
Source:
Parameters:
Name Type Attributes Description
success function The function to call on success.
Name Type Description
currentAlias string The alias as a string.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) getBadgeNumber(success, failureopt)

Returns the current badge number.
Source:
Parameters:
Name Type Attributes Description
success function The function to call on success.
Name Type Description
badgeNumber int The current application badge number.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) getChannelID(success, failureopt)

Returns the channel ID.
Source:
Parameters:
Name Type Attributes Description
success function The function to call on success.
Name Type Description
ID string The channel ID string
failure failureCallback <optional>
The function to call on failure.
Name Type Description
message string The error message.

(static) getChannelSubscriptionLists(successopt)

Returns the current set of subscription lists for the current channel, optionally applying pending subscription list changes that will be applied during the next channel update. An empty set indicates that this contact is not subscribed to any lists.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure.message string The error message.

(static) getContactSubscriptionLists(successopt)

Returns the current set of subscription lists for the current contact, optionally applying pending subscription list changes that will be applied during the next contact update. An empty set indicates that this contact is not subscribed to any lists.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure.message string The error message.

(static) getCurrentLocale(successopt)

Getting the locale currently used by Airship.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure.message string The error message.
Returns the last received deep link.
Source:
Parameters:
Name Type Attributes Description
clear Boolean true to clear the deep link.
success function The function to call on success.
Name Type Description
deepLink string The deep link.
failure failureCallback <optional>
The function to call on failure.
Name Type Description
message string The error message.

(static) getEnabledFeatures(successopt, failureopt)

Gets the current enabled features.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) getInboxMessages(success, failureopt)

Gets the array of inbox messages. Each message will have the following properties: "id": string - The messages ID. Needed to display, mark as read, or delete the message. "title": string - The message title. "sentDate": number - The message sent date in milliseconds. "listIconUrl": string, optional - The icon url for the message. "isRead": boolean - The unread/read status of the message. "extras": object - String to String map of any message extras.
Source:
Parameters:
Name Type Attributes Description
success function The function to call on success.
Name Type Description
messages array The array of inbox messages.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) getLaunchNotification(clear, success, failureopt)

Returns the last notification that launched the application.
Source:
Parameters:
Name Type Attributes Description
clear Boolean true to clear the notification.
success function The function to call on success.
Name Type Description
push object The push message object containing data associated with a push notification.
Name Type Attributes Description
message string The push alert message.
extras object Any push extras.
notification_id number <optional>
The Android notification ID.
failure failureCallback <optional>
The function to call on failure.
Name Type Description
message string The error message.

(static) getNamedUser(success, failureopt)

Returns the named user ID.
Source:
Parameters:
Name Type Attributes Description
success function The function to call on success.
Name Type Description
namedUser string The named user ID as a string.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) getPreferenceCenterConfig(preferenceCenterId, successopt, failureopt)

Returns the configuration of the Preference Center with the given ID trough a callback method.
Source:
Parameters:
Name Type Attributes Description
preferenceCenterId string The preference center ID.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) getQuietTime(success, failureopt)

Returns the quiet time as an object with the following: "startHour": Number, "startMinute": Number, "endHour": Number, "endMinute": Number
Source:
Parameters:
Name Type Attributes Description
success function The function to call on success.
Name Type Description
quietTime object The quietTime object represents a timespan during which notifications should be silenced.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) getTags(success, failureopt)

Returns the tags as an array.
Source:
Parameters:
Name Type Attributes Description
success function The function to call on success.
Name Type Description
tags array The tags as an array.
failure failureCallback <optional>
The function to call on failure.
Name Type Description
message string The error message.

(static) isAnalyticsEnabled(success, failureopt)

Checks if analytics is enabled or not.
Source:
Parameters:
Name Type Attributes Description
success function Success callback.
Name Type Description
enabled boolean Flag indicating if analytics is enabled or not.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) isAppNotificationsEnabled(success, failureopt)

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.
Source:
Parameters:
Name Type Attributes Description
success function Success callback.
Name Type Description
enabled boolean Flag indicating if app notifications is enabled or not.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) isFeatureEnabled(features, successopt, failureopt)

Checks if all of the given features are enabled.
Source:
Parameters:
Name Type Attributes Description
features array.<string> The features to check.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) isInQuietTime(success, failureopt)

Checks if the device is currently in quiet time.
Source:
Parameters:
Name Type Attributes Description
success function Success callback.
Name Type Description
inQuietTime boolean Flag indicating if quiet time is currently in effect.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) isQuietTimeEnabled(success, failureopt)

Checks if quiet time is enabled or not.
Source:
Parameters:
Name Type Attributes Description
success function Success callback.
Name Type Description
enabled boolean Flag indicating if quiet time is enabled or not.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) isSoundEnabled(success, failureopt)

Checks if notification sound is enabled or not.
Source:
Parameters:
Name Type Attributes Description
success function Success callback.
Name Type Description
enabled boolean Flag indicating if sound is enabled or not.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) isUserNotificationsEnabled(success, failureopt)

Checks if user notifications are enabled or not.
Source:
Parameters:
Name Type Attributes Description
success function Success callback.
Name Type Description
enabled boolean Flag indicating if user notifications is enabled or not.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) isVibrateEnabled(success, failureopt)

Checks if notification vibration is enabled or not.
Source:
Parameters:
Name Type Attributes Description
success function Success callback.
Name Type Description
enabled boolean Flag indicating if vibration is enabled or not.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) markInboxMessageRead(messageId, successopt, failureopt)

Marks an inbox message read.
Source:
Parameters:
Name Type Attributes Description
messageId String The ID of the message to mark as read.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) openPreferenceCenter(preferenceCenterId, successopt, failureopt)

Opens the Preference Center with the given preferenceCenterId.
Source:
Parameters:
Name Type Attributes Description
preferenceCenterId string The preference center ID.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) refreshInbox(successopt, failureopt)

Forces the inbox to refresh. This is normally not needed as the inbox will automatically refresh on foreground or when a push arrives thats associated with a message, but it can be useful when providing a refresh button for the message listing.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) resetBadge(successopt, failureopt)

Clears the badge.
Source:
Parameters:
Name Type Attributes Description
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) runAction(actionName, actionValue, successopt, failureopt)

Runs an Urban Airship action.
Source:
Parameters:
Name Type Attributes Description
actionName String action as a string.
actionValue *
success function <optional>
The function to call on success.
Name Type Description
result object The result's value.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setAlias(alias, successopt, failureopt)

Sets the alias.
Deprecated:
  • Deprecated since 6.7.0 - to be removed in a future version of the plugin - please use setNamedUser
Source:
Parameters:
Name Type Attributes Description
alias String string
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setAnalyticsEnabled(enabled, successopt, failureopt)

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).
Source:
Parameters:
Name Type Attributes Description
enabled Boolean true to enable analytics, false to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setAndroidForegroundNotificationsEnabled(enabled, successopt, failureopt)

Enables/Disables foreground notifications display on Android.
Source:
Parameters:
Name Type Attributes Description
enabled Boolean true to enable foreground notifications, false to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setAndroidNotificationConfig(config)

Sets the Android notification config. Values not set will fallback to any values set in the config.xml.
Source:
Parameters:
Name Type Description
config object The notification config.
Name Type Attributes Description
icon string <optional>
The name of the drawable resource to use as the notification icon.
largeIcon string <optional>
The name of the drawable resource to use as the notification large icon.
accentColor string <optional>
The notification accent color. Format is #AARRGGBB.

(static) setAssociatedIdentifier(Custom, The, successopt, failureopt)

Sets an associated identifier for the Connect data stream.
Source:
Parameters:
Name Type Attributes Description
Custom string key for identifier.
The string identifier value.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setAutobadgeEnabled(enabled, successopt, failureopt)

Enables or disables auto badge. Defaults to `NO`.
Source:
Parameters:
Name Type Attributes Description
enabled Boolean true to enable auto badge, false to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setAutoLaunchDefaultMessageCenter(enabled, successopt, failureopt)

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.
Source:
Parameters:
Name Type Attributes Description
enabled boolean true to automatically launch the default message center, false to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setBadgeNumber(number, successopt, failureopt)

Sets the badge number.
Source:
Parameters:
Name Type Attributes Description
number Number specified badge to set.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setCurrentLocale(localeIdentifier)

Overriding the locale.
Source:
Parameters:
Name Type Description
localeIdentifier string The locale identifier.

(static) setEnabledFeatures(features, successopt, failureopt)

Sets the current enabled features, replacing any currently enabled features with the given set.
Source:
Parameters:
Name Type Attributes Description
features array.<string> The features to set as enabled.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setNamedUser(namedUser, successopt, failureopt)

Sets the named user ID.
Source:
Parameters:
Name Type Attributes Description
namedUser String identifier string.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setNotificationTypes(types, successopt, failureopt)

Sets the iOS notification types. Specify the combination of badges, sound and alerts that are desired.
Source:
Parameters:
Name Type Attributes Description
types notificationType specified notification types.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setPresentationOptions(types, successopt, failureopt)

Sets the iOS presentation options. Specify the combination of badges, sound and alerts that are desired.
Source:
Parameters:
Name Type Attributes Description
types presentationOptions specified presentation options.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setQuietTime(startHour, startMinute, endHour, endMinute, successopt, failureopt)

Sets the quiet time.
Source:
Parameters:
Name Type Attributes Description
startHour Number for quiet time.
startMinute Number for quiet time.
endHour Number for quiet time.
endMinute Number for quiet time.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setQuietTimeEnabled(enabled, successopt, failureopt)

Enables or disables quiet time.
Source:
Parameters:
Name Type Attributes Description
enabled Boolean true to enable quiet time, false to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setSoundEnabled(enabled, successopt, failureopt)

Enables or disables notification sound.
Source:
Parameters:
Name Type Attributes Description
enabled Boolean true to enable sound, false to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setTags(tags, successopt, failureopt)

Sets the tags.
Source:
Parameters:
Name Type Attributes Description
tags Array an array of strings.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setUseCustomPreferenceCenterUi(preferenceCenterId, useCustomUi)

Sets the use custom preference center.
Source:
Parameters:
Name Type Description
preferenceCenterId string The preference center ID.
useCustomUi boolean The preference center use custom UI.

(static) setUserNotificationsEnabled(enabled, successopt, failureopt)

Enables or disables user notifications.
Source:
Parameters:
Name Type Attributes Description
enabled boolean true to enable notifications, false to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) setVibrateEnabled(enabled, successopt, failureopt)

Enables or disables notification vibration.
Source:
Parameters:
Name Type Attributes Description
enabled Boolean true to enable vibration, false to disable.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

(static) takeOff(config)

Initailizes Urban Airship. The plugin will automatically call takeOff during the next app init in order to properly handle incoming push. If takeOff is called multiple times in a session, or if the config is different than the previous sesssion, the new config will not be used until the next app start.
Source:
Parameters:
Name Type Description
config object The Urban Airship config.
Name Type Description
site string Sets the cloud site, must be either EU or US.
development object The Urban Airship development config.
Name Type Description
appKey string The development appKey.
appSecret string The development appSecret.
production object The Urban Airship production config.
Name Type Description
appKey string The production appKey.
appSecret string The production appSecret.

(static) trackScreen(screen, successopt, failureopt)

Initiates screen tracking for a specific app screen, must be called once per tracked screen.
Source:
Parameters:
Name Type Attributes Description
screen string The screen's string identifier.
success function <optional>
Success callback.
failure function <optional>
Failure callback.
Name Type Description
message string The error message.

Events

Event fired when a new deep link is received.
Source:
Type:
  • object
Parameters:
Name Type Attributes Description
deepLink string <optional>
The deep link.

inbox_updated

Event fired when the inbox is updated.
Source:

notification_opened

Event fired when notification opened.
Source:
Type:
  • object
Parameters:
Name Type Attributes Description
message string The push alert message.
extras object Any push extras.
notification_id number <optional>
The Android notification ID. Deprecated in favor of notificationId.
notificationId string <optional>
The notification ID.
actionID string <optional>
The ID of the notification action button if available.
isForeground boolean Will always be true if the user taps the main notification. Otherwise its defined by the notification action button.

notification_opt_in_status

Event fired when the user notification opt-in status changes.
Source:
Type:
  • object
Parameters:
Name Type Attributes Description
optIn boolean If the user is opted in or not to user notifications.
authorizedNotificationSettings object <optional>
iOS only. A map of authorized settings.
Name Type Description
alert boolean If alerts are authorized.
sound boolean If sounds are authorized.
badge boolean If badges are authorized.
carPlay boolean If car play is authorized.
lockScreen boolean If the lock screen is authorized.
notificationCenter boolean If the notification center is authorized.

push

Event fired when a push is received.
Source:
Type:
  • object
Parameters:
Name Type Attributes Description
message string The push alert message.
title string The push title.
subtitle string The push subtitle.
extras object Any push extras.
aps object The raw aps dictionary (iOS only)
notification_id number <optional>
The Android notification ID. Deprecated in favor of notificationId.
notificationId string <optional>
The notification ID.

registration

Event fired when a channel registration occurs.
Source:
Type:
  • object
Parameters:
Name Type Attributes Description
channelID string <optional>
The channel ID.
registrationToken string <optional>
The deviceToken on iOS, and the FCM/ADM token on Android.
error string <optional>
Error message if an error occurred.

show_inbox

Event fired when the inbox needs to be displayed. This event is only emitted if auto launch message center is disabled.
Source:
Type:
  • object
Parameters:
Name Type Attributes Description
messageId string <optional>
The optional message ID.