Install and Set Up the Cordova Plugin
How to install the Airship Cordova plugin.
If you use an AI coding assistant, the Airship MCP server can walk you through upgrading to a new Airship SDK version. It detects your platform and current version, then guides you through each required change. See SDK migration in Airship MCP Server.
Requirements
- cordova-ios 8.0.0 or higher
- cordova-android 15.0.0 or higher
- iOS 16+ (Xcode 26+)
- Android API 23+
Setup
Install the plugin using Cordova CLI:
cordova plugin add @ua/cordova-airshipFor HMS support, you will also need the HMS module:
cordova plugin add @ua/cordova-airship-hmsiOS
Modify the app’s config.xml to enable swift support and set the min iOS version:
<!-- Deployment target must be >= iOS 16 -->
<preference name="deployment-target" value="16.0" />
<!-- Must be >= 5.0 -->
<preference name="SwiftVersion" value="5.0" />Initialize Airship
Before you can access any of the module’s API, the Airship module needs to be initialized. This can be accomplished by calling takeOff when the device is ready.
// TakeOff
Airship.takeOff({
production: {
appKey: "<APP_KEY>",
appSecret: "<APP_SECRET>"
},
development: {
appKey: "<APP_KEY>",
appSecret: "<APP_SECRET>"
},
inProduction: true,
site: "us", // use "eu" for EU cloud projects
urlAllowList: ["*"],
android: {
notificationConfig: {
icon: "ic_notification",
accentColor: "#00ff00"
}
}
})Takeoff can be called multiple times, but the config passed in takeOff won’t be applied until the next app init.
For a complete list of configuration options, see the AirshipConfig reference.
Test the integration
After completing the setup, verify your integration:
- Build and run your app on your iOS or Android device/simulator/emulator.
- Check the console output for Airship channel creation:
- iOS: Look for a log message in Xcode console:
Channel ID: <CHANNEL_ID> - Android: Look for a log message in logcat:
Airship channel created: <CHANNEL_ID> - The channel ID confirms successful SDK initialization.
- For more detailed logging, see Logging.
- iOS: Look for a log message in Xcode console:
If you see the channel ID in the console and no errors, your integration is successful.
Next steps
- Advanced Configuration: Configure URL allowlists and other advanced settings
- Get Started with Push Notifications — configure push notifications
- Deep Links: Handle deep links in your app
If you don’t see a channel ID or encounter errors during initialization, see Troubleshooting Initialization for common problems and solutions.