Install and Set Up the React Native Module
How to install the Airship React Native module.
The Airship React Native module provides a TypeScript-first interface for React Native apps. It wraps the native iOS and Android Airship SDKs, giving you full access to all platform features while maintaining a JavaScript/TypeScript developer experience with strong typing and modern async/await patterns.
Requirements
- React Native 0.85+
iOS
- Xcode
27+ - minimum deployment target iOS
16+
Android
- minSdkVersion
26+ - compileSdkVersion
36+
For the current support status of each module major, EOL dates, and the full lifecycle policy, see the SDK Support Policy.
Standard React Native Setup
Install the plugin using yarn or npm:
yarn add @ua/react-native-airshipiOS Integration
This module supports two iOS dependency managers:
CocoaPods (default). The Airship SDK is pulled in through React Native’s CocoaPods+SPM bridge rather than a published pod. Add the following to your
ios/Podfile; statically linking it produces duplicate-symbol errors at link time:use_frameworks! :linkage => :dynamicSwift Package Manager (experimental). React Native 0.87+ adds an experimental, opt-in SwiftPM integration as an alternative to CocoaPods. This module ships a
Package.swift, so it’s picked up automatically once your app is set up for SwiftPM:cd ios npx react-native spmReact Native’s SwiftPM support is still experimental. On React Native < 0.88, the generated autolinking package hardcodes an iOS 15 minimum, which prevents this module and any other package that requires iOS 16 from resolving. React Native 0.88 fixes this by reading the floor from your app’s own Xcode deployment target instead.
Expo Setup
Apps using Expo’s managed workflows can use the airship-expo-plugin to configure the project.
expo install airship-expo-pluginyarn add @ua/react-native-airshipConfigure the plugin
Add the plugin to the app.json with the app’s config:
"plugins":[
[
"airship-expo-plugin",
{
"android":{
"icon": "./assets/ic_notification.png",
"customNotificationChannels": "./assets/notification_channels.xml",
"airshipExtender": "./assets/AirshipExtender.kt"
},
"ios":{
"mode": "development",
"notificationService": "./assets/NotificationService.swift",
"notificationServiceInfo": "./assets/NotificationServiceExtension-Info.plist",
"notificationServiceTargetName": "NotificationServiceExtension",
"developmentTeamID": "MY_TEAM_ID",
"deploymentTarget": "15",
"airshipExtender": "./assets/AirshipPluginExtender.swift"
}
}
]
]Android Config:
- icon: Required. Local path to an image to use as the icon for push notifications. 96x96 all-white png with transparency. The name of the icon will be the resource name.
- customNotificationChannels: Optional. The local path to a Custom Notification Channels resource file.
- airshipExtender: Optional. The local path to a AirshipExtender.kt file.
iOS Config:
- mode: Required. The APNS entitlement. Either
developmentorproduction. - notificationService: Optional. The local path to a custom Notification Service Extension or
DEFAULT_AIRSHIP_SERVICE_EXTENSIONfor Airship’s default one. - notificationServiceInfo: Optional. Airship will use a default one if not provided. The local path to a Notification Service Extension Info.plist.
- notificationServiceTargetName: Optional. Defaults to NotificationServiceExtension if not provided.
- developmentTeamID: Optional. The Apple Development Team ID used to configure the Notification Service Extension target.
- deploymentTarget: Optional. The minimum Deployment Target version used to configure the Notification Service Extension target. Defaults to iOS 15.
- airshipExtender: Optional. The local path to a AirshipPluginExtender.swift file.
Calling TakeOff
takeOff should be called in a standard application at the beginning of the lifecycle. Once takeOff is called, the config will be stored and applied for future app inits. If takeOff is called again with a different config, the new config will not be applied until the next app init.
import Airship from '@ua/react-native-airship';
Airship.takeOff({
default: {
appKey: "YOUR_APP_KEY",
appSecret: "YOUR_APP_SECRET"
},
site: "us", // use "eu" for EU cloud projects
urlAllowList: ["*"],
android: {
notificationConfig: {
icon: "ic_notification",
accentColor: "#00ff00"
}
}
});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
- Extending Airship: Access native SDK features for advanced customization
- 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.