Getting Started

Configure Apple and UA services, and integrate Airship with your native iOS app before sending your first push notification.


Sample Apps

API Docs


  • Minimum iOS version supported 11+
  • Requires Xcode 13+

An Important Note about Location

As of Spring 2019, Apple has begun rejecting applications that use, or appear to use, Core Location services without supplying usage descriptions in their Info.plist files. In Airship SDK 11.0, all references to CoreLocation were removed from the core library and placed in a separate location framework. Developers with no need for location services can continue to use Airship as before, but for those who have been using the UALocation class, see the Location sections for updated setup instructions.


As of SDK 10.2 and Apple’s current App Store review policies, apps building against Airship without location usage descriptions in Info.plist are likely to be rejected. To avoid this, either use SDK 11.0 or newer, or add usage description strings to your Info.plist file under the NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription, and NSLocationAlwaysAndWhenInUseUsageDescription keys.

Apple Setup

Before you can integrate Airship into your iOS apps, there are a handful of steps you must take on the Apple end of things, which requires membership in the iOS Developer Program.

We will be using the Apple Push Notification Service (APNs) as the transport method for iOS push notifications. In the next section we will configure a development app and a production app for push services.

Production vs. Development Apps

When you create or edit an Airship project (and thus its application record on our server), you must select whether your app system is Test (development for sending test messages), or Live (production for sending messages to customers). We suggest making two projects in the Airship dashboard, so that you can continue to build and develop your application even after releasing it, without interrupting your users.


To support Catalyst apps in Xcode 11+, it’s necessary that your app be built with a provisioning profile that includes an Apple Developer certificate (for use in Xcode 11 or later) and the Mac capability listed under Enabled Capabilities:


Do not a) submit to the App Store or b) test notifications on an ad hoc build while your app’s code is pointing to an Airship app key that is set as Test. Test apps use different tokens that, when included in a push to a Live app, will fail and in many cases cause all other pushes to fail.

Always create a Live Airship project first, and make sure your application code is pointing to the live project’s app key. For more tips on what to check before you release your app, see the iOS Production Launch Checklist).

Register Your Authentication Signing Key


We recommend that new applications use token signing for authentication, described below. For instructions on setting up certificate-based authentication, see iOS Push Certificate Authentication.

  1. Log in to the Apple Developer Member Center.

  2. Go to Account » Membership and copy your Team ID. You’ll need this ID when you configure the APNs service in Airship later.

  3. In the left side menu, go to Certificates, IDs & Profiles » Identifiers, and click your app’s name in the list of App IDs.


    If you have not already registered an iOS App ID, click +, select App IDs, then click Continue:

    Fill out the Register an App ID form. Note your Bundle ID, then check the Push Notifications checkbox and click Continue and Register. Now can skip to step 4 below.

  4. Note your Bundle ID and check the box for Push Notifications, then click Save. If Push Notifications was already enabled, click All Identifiers at the top of the page to go back.

  5. In the left side menu, click Keys.

  6. Click + to register a new key, then enter a unique key name and enable Apple Push Notifications service (APNs). Click Continue.

  7. Click Register to finish registering your key.

  8. On the following screen, note your Key ID and Click Download to save the key in .p8 format.


    Be sure to save your key in a secure location if you intend to use it across multiple apps or Airship projects. Apple only allows two registered APNs keys per team, so reaching this limit would require you to revoke one of your existing keys before creating a new one, which in turn would require an update for any apps previously using the revoked key. Airship will not make your key available for download or sharing across projects once it has been uploaded.

Airship Steps

Configure your iOS project for push notifications in the Airship dashboard.

Configure the APNs Service

You will need your downloaded .p8 file and noted Team, Bundle, and Key IDs from the previous section.


Airship defaults to token-based authentication for APNs, but will fall back on certificates if token authentication is not configured. For existing projects, it is recommended that you leave your certificate in place when migrating to token-based authentication so that push can be quickly restored if there are any issues during that process. Also, if you remove your certificate before setting up token-based authentication, you may have a period when you cannot send messages.

After confirming token-based authentication is working, you can let the certificate expire, or revoke the certificate from the Apple Developer Member Center.

  1. Go to Settings » Channels » Mobile Apps » iOS.
  2. Click Edit for Token-based authentication.
  3. Upload the .p8 file and enter your Team, Bundle, and Key IDs.
  4. Click Save.

Your authentication signing key is now uploaded and ready for use. In the next section we will configure the Airship iOS SDK.

SDK Installation

The Airship SDK can be installed using CocoaPods, Swift Package Manager, Carthage, or manually. Pick the option that makes the most sense for your project.


Before you begin, ensure that you have CocoaPods installed. If you are having troubles with CocoaPods, check out the troubleshooting guide.

$ gem install cocoapods

Update the podfile

The primary Airship pod includes the standard feature set and is advisable to use for most use cases. The standard feature set includes:

  • Core : Push messaging features including channels, tags, named user and default actions
  • MessageCenter : Message center
  • Automation : Automation and in-app messaging
  • ExtendedActions : Extended action functionality including the rate app action

The primary Airship pod includes the subspecs Airship/Core, Airship/MessageCenter, Airship/ExtendedActions and Airship/Automation - making it unnecessary to explicitly include these when using the primary pod.

Example podfile:

# Airship SDK
target "<Your Target Name>" do
  pod 'Airship'


The Airship pod also contains several subspecs that can be installed independently and in combination with one another when only a particular selection of functionality is desired:

  • Airship/Core : Push messaging features including channels, tags, named user and default actions
  • Airship/MessageCenter : Message center
  • Airship/Automation : Automation and in-app messaging
  • Airship/ExtendedActions : Extended actions
  • Airship/Location : Deprecated location module.
  • Airship/PreferenceCenter : Preference Center module.

Example podfile:

target "<Your Target Name>" do
  pod 'Airship/Core'
  pod 'Airship/MessageCenter'
  pod 'Airship/Automation'
  pod 'Airship/ExtendedActions'

Explicitly specify the tvOS platform in your podfile when targeting tvOS. Cocoapods automatic platform selection can also be used if the platform must be left unspecified.

When targeting tvOS - specify the platform in your podfile:

platform :tvos, '11.0'

Install the pods

$ pod install

After running pod install, an Xcode workspace (extension .xcworkspace) will be generated. Make sure to always open it instead of the project file (extension .xcodeproj) when building your projects.

Swift Package Manager

In your Xcode project, go to the Package Dependencies tab of the project settings.

Add a new package by clicking on the plus sign (+).

Then search for the package using the url.

Choose Airship package products that you want to include in your app.

Advanced Installation

Notification Service Extension

To take advantage of notification attachments, such as images, animated gifs, and video, you will need to create a notification service extension.

Create a new iOS target in Xcode

In Xcode, click the File menu, select New » Target…, then click the Notification Service Extension template.

Typically extensions are named with a suffix on the main application’s ID. In this example the bundle identifier would be com.urbanairship.sample.ExampleServiceExtension.

Check that your app’s target Embed App Extensions contains your newly created extension.

Install Airship Notification Service Extension Dependencies


Service extensions depend on the NotificationService subspec of the AirshipExtensions pod.

Example podfile:

target "<Your Service Extension Target Name>" do
  pod 'AirshipExtensions/NotificationService'

Install using the following command:

$ pod install


Before you begin, ensure you have Carthage installed.

Adding the SDK framework to your application

Follow Carthage’s adding frameworks to an application instructions to add AirshipNotificationServiceExtension.framework to your service extension target.

If you are also using the Airship SDK, follow the instructions in the iOS SDK Guide.

Specify the Airship iOS SDK in your cartfile:

github "urbanairship/ios-library"

Verify Enable Modules and Link Frameworks Automatically are enabled in the project’s Build Settings.


Follow the same manual process to install AirshipNotificationServiceExtension.xcframework using the same method that you followed to install Airship.xcframework, except add AirshipNotificationServiceExtension.framework to your service extension target.

Modify the Service Extension



// Notification.swift

import AirshipExtensions

class NotificationService: UANotificationServiceExtension {

// NotificationService.h

@import AirshipExtensions;

@interface NotificationService : UANotificationServiceExtension


// NotificationService.m

@import Foundation;
import "NotificationService.h"

@implementation NotificationService


Carthage and Manual


// Notification.swift

import AirshipNotificationServiceExtension

class NotificationService: UANotificationServiceExtension {

// NotificationService.h

@import AirshipNotificationServiceExtension;

@interface NotificationService : UANotificationServiceExtension


// NotificationService.m

@import Foundation;
import "NotificationService.h"

@implementation NotificationService


Delete all dummy source code for your new extension and inherit from UANotificationServiceExtension in NotificationService.

Notification Content Extension

To provide a custom interface when a user previews your notification in the notification center, you will need to create a notification content extension by following the instructions in the content extension guide.

App Clips

To add an App Clip to your application, you will need to create a new target in your project by following the instructions in The App Clips guide.

Update the Target’s Capabilities

Use Xcode to enable push notifications in the target’s Capabilities pane:

Enable background notifications by including the UIBackgroundModes key with the remote-notification value in your app’s Info.plist file. When viewing the plist in Xcode, UIBackgroundModes is displayed as Required background modes and remote-notification is displayed as App downloads content in response to push notifications.

You can also enable Background Modes and Remote notifications under the target’s Capabilities section:

Create Airship Config Options

Create a plist AirshipConfig.plist and include it in your application’s target. The default config will be loaded from the AirshipConfig.plist file if its included in the application target.

Example AirshipConfig.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
  <string>Your Development App Key</string>
  <string>Your Development App Secret</string>
  <string>Your Production App Key</string>
  <string>Your Production App Secret</string>

EU Cloud Site

If your app uses Airship’s EU cloud site, you will need to add that to AirshipConfig.plist.



The Airship SDK requires only a single entry point in the app delegate, known as takeOff. Inside your application delegate’s application:didFinishLaunchingWithOptions: method, initialize a shared Airship instance by calling UAAirship takeOff . This will bootstrap the SDK and look for settings specified in the AirshipConfig.plist config file.

Example app delegate changes
import AirshipKit


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    Airship.takeOff(launchOptions: launchOptions)

    return true
@import AirshipKit;


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [UAirship takeOffWithLaunchOptions:launchOptions];

    return YES;

TakeOff must be called on the main thread and before application:didFinishLaunchingWithOptions: returns.

Send Your First Push Notification


Remote notifications are only available on a real device. You will not be able to send any notifications through APNs on a simulator.

At this point in the guide, if you followed all the steps above you should be ready to send a test push notification to verify everything is set up properly.

Before sending a push, you must enable user notifications. The SDK does not enable user notifications by default in order to avoid prompting the user for permissions before your app is ready to do so. But for a testing purposes, you can enable user notifications in the app delegate immediately after takeOff. You may also want to set default foreground presentation options to display the notification in the foreground. For more information on customizing push notifications or receiving callbacks, see Push Notifications.

Enable notifications for a quick test after calling takeOff
Airship.push.userPushNotificationsEnabled = true
Airship.push.defaultPresentationOptions = [.alert, .badge, .sound]
[UAirship.push.userPushNotificationsEnabled = YES;
[UAirship.push.defaultPresentationOptions = (UNNotificationPresentationOptionAlert |
                                             UNNotificationPresentationOptionBadge |

See Send Your First Message or our API reference for details on sending the first notification.

URL Allow List


As of SDK 14.0, open URL scoped URLs are now always verified.

The UAURLAllowList controls which URLs the Airship SDK is able to act on. The SDK divides up usages of URLs into two different scopes:

  • URLAllowListScopeOpenURL: Only URLs allowed for this scope can be opened from an action, displayed in landing page, displayed in an HTML in-app message, or displayed as media in an In-App Automation. Defaults to any Airship-originated URLs and YouTube URLs.
  • URLAllowListScopeJavaScriptInterface: These URLs are checked before the Airship JavaScript interface is injected into the webview. Defaults to any Airship-originated URLs.
  • URLAllowList: Applies to both URLAllowListScopeOpenURL & URLAllowListScopeJavaScriptInterface.

The easiest way to expand the list of allowed URLs is to provide a list of URL patterns in the AirshipConfig.plist.

Example config URL pattern syntax


Valid URL pattern syntax
<pattern> := '*' | <scheme>'://'<host>/<path> | <scheme>'://'<host> | <scheme>':/'<path> | <scheme>':///'<path>
<scheme> := <any char combination, '*' are treated as wild cards>
<host> := '*' | '*.'<any char combination except '/' and '*'> | <any char combination except '/' and '*'>
<path> := <any char combination, '*' are treated as wild cards>

Deep Linking

Deep linking is a technique that allows an app to be opened to a specific UI or resource, in response to some external event. By implementing a deep linking strategy, your app becomes more responsive and capable of navigation to arbitrary content in response to push notifications, much in the same way that URLs can link you to specific pages on the Web.

With the Actions Framework, the Airship SDK now supports opening deep links from push notifications, and through Rich HTML content interactions. Because there is no one standard means of performing deep linking, this support only provides a consistent interface for triggering deep links. As an application developer, you still need to pick a deep linking strategy and perform some manual integration to be able to take advantage of this feature.

There are two common strategies for deep linking in iOS. For most applications, implementing the DeepLinkDelegate will be the preferred strategy. This allows complete control over URL processing and sidesteps the need to register a unique URL scheme with the operating system. The alternative strategy is to register a unique URL scheme with the operating system and handle URL processing in the App Delegate’s openURL: callback.

Deep linking is most easily accomplished by registering a delegate with the SDK that implements the DeepLinkDelegate protocol. To register a delegate named myDelegate:

UAirship.shared.deepLinkDelegate = myDelegate;
Airship.shared.deepLinkDelegate = myDelegate

Next, in your delegate class, implement the receivedDeepLink:completionHandler: callback. This allows your app to process the URL provided in a DeepLinkAction and use it to navigate to the desired view within your app.

- (void)receivedDeepLink:(NSURL *_Nonnull)deepLink completionHandler:(void (^_Nonnull)(void))completionHandler {
    NSArray *pathComponents = url.pathComponents;

    if ([pathComponents containsObject:ViewStoryboardID]) {
        // Navigate to desired view

    // Call completion handler
func receivedDeepLink(_ deepLink: URL, completionHandler: @escaping () -> ()) {
    let pathComponents = url.pathComponents

    if pathComponents.contains(ViewStoryboardID) {
      // Navigate to desired view

    // Call completion handler

If necessary, please see our Troubleshooting Guide for help with common setup issues.