Top level Airship instance.
Event sent when the channel created. The event body will include:
- channelId: String. The channel ID of the app instance.
Event sent when the notification opt-in status changes. The event body will include:
- optIn: Boolean. True if the notifications are opted-in, otherwise false.
- authorizedSettings: Array of authorized settings.
Event sent when a push is received. The event body will include:
- payload: The full message payload. Will be different between iOS and Android.
- notification:
- title: String. The message's title.
- alert: String. The message's alert.
- notificationId: (Android only) String. The notification ID
- extras: Object. The message's extras.
Event sent when a notification response is received. The event body will include:
- payload: The full message payload. Will be different between iOS and Android.
- notification:
- title: String. The message's title.
- alert: String. The message's alert.
- notificationId: (Android only) String. The notification ID.
- extras: Object. The message's extras.
- actionId: String. The button action Id if a button was tapped.
- isForeground: Boolean. True if the response will foreground app, otherwise false.
Verbose log level.
Debug log level.
Info log level.
Warning log level.
Error log level.
Used to disable logging.
EU cloud site.
US cloud site.
Called to initialize the Airship instance. Airship can only be initialized once per app init. Config will be cached and applied to the following app inits. If takeOff is called after Airship is initialized, the config will be applied to the next app run.
config:
- default: Environment.
- production: Environment.
- development: Environment.
- inProduction: Boolean. true if in production, false if development. If not set, the plugin will auto determine the flag.
- site: The cloud site. Defaults to US.
- enabledFeatures: The list of features to enable by default. Use
["none"]
to disable all features. - urlAllowList: Array of strings. A list of allow list rules. Use
["*"]
to allow all Urls. Applies to bothurlAllowListScopeOpenUrl
andurlAllowListScopeJavaScriptInterface
- urlAllowListScopeOpenUrl: Array of allow list rules for URLs that the SDK is allowed to open.
- urlAllowListScopeJavaScriptInterface: Array of allow list rules for URLs that the SDK is should inject the JS interface when loaded in a web view.
- android
- appStoreUri: The app store Uri. Used by the rate app action.
- fcmFirebaseAppName: The firebase app name if using a FCM project other than default.
- notificationConfig:
- icon: The notification icon name.
- largeIcon: The notification large icon name.
- accentColor: The notification accent color a color string #AARRGGBB
- defaultChannelId: The default notification channel/category.
- iOS
- itunesId: The itunes ID. Used by the rate app action.
Environment:
- appKey: The app key.
- appKey: The app secret.
- logLevel: The log level.
A valid environment is required, everything else is optional. Production and development environment will override default depending.
Boolean property that indicates if Airship is initialized or not.
The channel instance.
The contact instance.
The push instance.
The analytics instance.
The locale instance.
The in-app automation instance.
The message center instance.
The preference center instance.
The privacy manager instance.
Provides access to channel level segmentation properties.
The channel identifier. The identifier will not be available right away on the first run, use Airship.eventChannelCreated
to listen for when the channel is created.
Sets or gets the channel tags. Tags can be used to segment the audience. Applications should use Airship.editTags() to add or remove tags.
Airship.channel.tags = ["test", "titanium"]
Creates a tag editor instance for the channel. Once edits are done, make sure to call apply on the instance to save changes to the channel.
Airship.channel.editTags()
.addTags(["foo"])
.removeTags(["cool", "neat"])
.apply()
Creates a tag group editor instance for the channel. Once edits are done, make sure to call apply on the instance to save changes to the channel.
Airship.channel.editTagGroups()
.addTags("some-group", ["foo"])
.removeTags("some-other-group", ["cool", "neat"])
.apply()
Creates a subscription list editor instance for the channel. Once edits are done, make sure to call apply on the instance to save changes to channel.
Airship.channel.editSubscriptionLists()
.subscribe("bears")
.unsubscribe("battle-star")
.apply()
Creates an attribute editor instance for the channel. Once edits are done, make sure to call apply on the instance to save changes to the channel.
Airship.channel.editAttributes()
.setAttribute("favorite_color", "red")
.apply()
Fetches the current subscription lists for the channel. The lists are an array of subscription ids that the channel is currently subscribed to. The result body includes:
- error: An error if it failed ot fetch subscriptions.
- subscriptions: The list of subscriptions.
Airship.channel.fetchSubscriptionLists(function (result) {
Ti.API.info("lists: " + JSON.stringify(result))
});
Provides access to segmentation data at the contact/user level. If a contact is not named you can still apply attributes, tags, and subscription lists as an anonymous contact.
The app scope when getting/setting subscription lists.
The web scope when getting/setting subscription lists.
The email scope when getting/setting subscription lists.
The SMS scope when getting/setting subscription lists.
The current named user Id that was set through the App.
Creates a tag group editor instance for the contact. Once edits are done, make sure to call apply on the instance to save changes to the contact.
Airship.contact.editTagGroups()
.addTags("some-group", ["foo"])
.removeTags("some-other-group", ["cool", "neat"])
.apply()
Creates a scoped subscription list editor instance for the contact. Once edits are done, make sure to call apply on the instance to save changes to contact.
Airship.contact.editSubscriptionLists()
.subscribe("bears", Airship.contact.scopeApp)
.unsubscribe("battle-star", Airship.contact.scopeEmail)
.apply()
Creates an attribute editor instance for the contact. Once edits are done, make sure to call apply on the instance to save changes to the contact.
Airship.contact.editAttributes()
.setAttribute("favorite_color", "red")
.apply()
Fetches the current subscription lists for the channel. The result body includes:
- error: An error if it failed ot fetch subscriptions.
- subscriptions: A map of subscribed Ids to a list of scopes.
Airship.contact.fetchSubscriptionLists(function (result) {
Ti.API.info("lists: " + JSON.stringify(result))
});
Identifies the contact.
Airship.contact.identify("bart")
Resets the contact.
Airship.contact.reset()
Enables or disables user notifications. On iOS, enabling notifications the first time will prompt the user to enable notifications.
Airship.push.userNotificationsEnabled = true;
Enables user notifications with a callback with the result.
Airship.enableUserNotifications((function(result) {
Ti.API.info("Notifications Enabled: " + result.success)
})
Gets the current notification status:
- systemEnabled: Boolean. True if notifications are enabled in the system settings for the app or false.
- airshipOptIn: Boolean. True if push notifications are receivable through Airship.
Push extensions for iOS.
Authorized setting for alert.
Authorized setting for badge.
Authorized setting for sound.
Authorized setting for announcement.
Authorized setting for car play.
Authorized setting for critical alert.
Authorized setting for notification center.
Authorized setting for scheduled delivery.
Authorized setting for time sensitive notifications.
Authorized setting for lock screen.
Foreground presentation option for alert. Use list or banner for iOS 14.
Foreground presentation option for badge.
Foreground presentation option for sound.
Foreground presentation option for list. iOS 14+ only.
Foreground presentation option for banner. iOS 14+ only.
Notification option for alert.
Notification option for badge.
Notification option for sound.
Notification option for car play.
Notification option for critical alert.
Notification option if your app provides settings for notifications.
Notification option for provisional notifications.
Authorized notification status.
Ephemeral notification status.
Provisional notification status.
Not determined notification status.
Denied notification status.
Gets or sets the foreground presentation options.
Gets or sets the notification options.
Property to enable or disable auto badge on iOS.
The badge number on iOS.
Resets the badge to zero.
Pauses or resumes In-App messaging.
Airship.isInAppAutomationPaused = true
All features.
No features.
Push notification feature.
Message Center feature.
In-App Automation feature.
Contacts feature.
Tags, Attributes, and Subscription feature.
Analytics feature.
Chat feature.
Location feature.
Privacy manager controls what features and data is collected by the Airship SDK.
Gets or sets the list of enabled features.
Adds features to the enabled set.
Removes features to the enabled set.
Creates an editor to edit the associated identifiers.
Airship.analytics.editAssociatedIdentifiers()
.setIdentifier("foo", "bar")
.apply();
Creates a new event with the given event name.
var event = Airship.analytics.newEvent("foo")
event.eventValue = 100.0
event.eventProperties = {
someBoolean: true,
someDouble: 124.49,
someString: "customString",
someInt: 5,
someLong: 1234567890,
someArray: ["tangerine", "pineapple", "kiwi"]
}
event.track()
Tracks a screen.
Airship.trackScreen("home")
Locale controls which locale is configured for the Channel when using Airship messaging features.
Gets or sets the locale for Airship.
Reset the locale to the app's locale.
Resumes or pauses in-app automations.
Sets the display interval in milliseconds.
Sets if Airship should automatically display a preference center for the given ID or not.
Displays a preference center with the given ID. If useCustom
is set for the preference center Id, it will
emit an event instead of displaying the preference center.
Gets the config for the preference center.
The list of messages.
Marks a message read.
Deletes a message.
Displays the message center.
Displays the message.
Displays the message center.
Airship.displayMessageCenter()
Editor for a contact subscription lists.
Subscribes to a list with the given scope.
Unsubscribes from a list with the given scope.
Applies the changes.
Editor for a channel subscription lists.
Subscribes to a list.
Unsubscribes from a list.
Applies the changes.
Adds tags.
Removes tags.
Clears the tags.
Applies the changes.
Adds tags to the group.
Removes tags from the group.
Applies the changes.
Sets the attribute. The value can be a number, string, or date.
Removes the attribute.
Applies the changes.
Sets the identifier. Both need to be a string.
Removes the identifier.
Applies the changes.
The event value. Must be a number.
Sets the transaction ID.
Sets the interaction ID. Both ID and type must be set if one is set.
Sets the interaction type. Both ID and type must be set if one is set.
Additional event properties. Must be a JSON object.
Tracks the event.