# Install and Set Up the Apple SDK

Learn how to install the Airship SDK using SPM, CocoaPods, Carthage, or xcframeworks, and initialize the SDK in your iOS, tvOS, or visionOS applications.

The Airship SDK is a modern, Swift 6-native SDK designed for Apple platforms. It provides type-safe, actor-isolated APIs with full Swift concurrency support that work seamlessly across iOS, tvOS, and visionOS — all from a single SDK.

For a complete reference of feature support across iOS, tvOS, and visionOS, see [Platform Support](https://www.airship.com/docs/developer/sdk-integration/apple/resources/#platform-support).

> **Tip:** If you use an AI coding assistant, you can connect it to Airship with Skills and an MCP server. See [Airship AI Tools](https://www.airship.com/docs/developer/ai-tools/ai-tools/).

## Requirements

* Minimum iOS version: 16.0+
* Minimum tvOS version: 18.0+
* Minimum visionOS version: 1.0+
* Requires Xcode 26.0+

## SDK installation

The Airship SDK can be installed using SPM (Swift Package Manager), CocoaPods, Carthage, or xcframeworks. We recommend SPM for new projects.


#### SPM



1. In your Xcode project, select your project in the Project Navigator.
2. Select your target, then go to the **Package Dependencies** tab.
3. Click the **+** button to add a package.
4. Enter the package URL: `https://github.com/urbanairship/ios-library`
5. Select the version rule (recommended: "Up to Next Major Version").
6. Click **Add Package**.
7. Select the Airship package products you want to include in your app:

   **Available package products:**
   - `AirshipBasement` : Required by AirshipCore
   - `AirshipCore` : Push messaging features including channels, tags, named user and default actions (required)
   - `AirshipMessageCenter` : Message center
   - `AirshipAutomation` : Automation and in-app messaging
   - `AirshipPreferenceCenter` : Preference Center
   - `AirshipFeatureFlags` : Feature Flags
   - `AirshipObjectiveC` : Objective-C Bindings
   - `AirshipDebug` : Debugging tools
   - `AirshipNotificationServiceExtension` : Service Extension framework (only for Notification Service Extension targets, not the app target)*

8. Click **Add Package**.

9. Import the modules in your code where needed. Import statements match the module names:

```swift
import AirshipCore
import AirshipMessageCenter
import AirshipAutomation
```


For more details, see Apple's guide on [adding package dependencies to your app](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).



#### Cocoapods



> **Note:** CocoaPods trunk is [moving to read-only mode in December 2026](https://blog.cocoapods.org/CocoaPods-Specs-Repo/). Airship will continue to support CocoaPods as long as possible, but we recommend using SPM (Swift Package Manager) for new projects. Existing CocoaPods installations will continue to work after trunk becomes read-only.


1. Install CocoaPods if you haven't already:

`$ gem install cocoapods`

2. Navigate to your project directory in Terminal.

3. Create a `Podfile` (if one doesn't exist):

`$ pod init`

4. Open your `Podfile` and add the Airship pod. The `Airship` pod is modular and divided into subspecs:

**Available subspecs:**
- `Airship/Core` : Push messaging features including channels, tags, named user and default actions (required)
- `Airship/MessageCenter` : Message center
- `Airship/Automation` : Automation and in-app messaging
- `Airship/PreferenceCenter` : Preference Center module
- `Airship/FeatureFlags` : Feature Flags module
- `Airship/ObjectiveC` : Objective-C bindings

```ruby
target "<Your Target Name>" do
  pod 'Airship'
end
```


**Or specify individual subspecs:**

```ruby
target "<Your Target Name>" do
  pod 'Airship/Core'
  pod 'Airship/MessageCenter'
  pod 'Airship/Automation'
  pod 'Airship/FeatureFlags'
end
```


**For tvOS projects, specify the platform:**

```ruby
platform :tvos, '18.0'

target "<Your Target Name>" do
  pod 'Airship'
end
```



5. Install the pods:

`$ pod install`

6. **Important:** After running `pod install`, an Xcode workspace (`.xcworkspace`) file is generated. Always open the workspace file instead of the project file (`.xcodeproj`) when building your project.

If you encounter issues, see the [CocoaPods troubleshooting guide](http://guides.cocoapods.org/using/troubleshooting.html).




#### Carthage



1. Install Carthage if you haven't already. See the [Carthage installation guide](https://github.com/Carthage/Carthage#installing-carthage).

2. Verify `Enable Modules` and `Link Frameworks Automatically` are enabled in your project's Build Settings.

3. Follow Carthage's [adding frameworks to an application](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) instructions to add frameworks to your application.

4. Specify the Airship iOS SDK in your `Cartfile`:

```text
github "urbanairship/ios-library"
```


5. Build the frameworks:

`$ carthage update`

6. Add the frameworks to your project. Airship is modular, so select only the frameworks you need:

   **Available frameworks:**
   - `AirshipBasement` : Required by AirshipCore
   - `AirshipCore` : Push messaging features including channels, tags, named user and default actions (required)
   - `AirshipMessageCenter` : Message center
   - `AirshipAutomation` : Automation and in-app messaging
   - `AirshipPreferenceCenter` : Preference Center
   - `AirshipFeatureFlags` : Feature Flags
   - `AirshipObjectiveC` : Objective-C Bindings
   - `AirshipDebug` : Debugging tools
   - `AirshipNotificationServiceExtension` : Service Extension framework (only for Notification Service Extensions)*

7. Import the frameworks in your code. Import statements match the framework names:

```swift
import AirshipCore
import AirshipMessageCenter
import AirshipAutomation
```




#### xcframeworks



1. Download and decompress the latest version of the [iOS SDK](https://github.com/urbanairship/ios-library/releases).

2. Inside the folder you should see a collection of XCFrameworks. Airship is modular, so select only the XCFrameworks you need:

   **Available XCFrameworks:**
   - `AirshipBasement.xcframework` : Required by AirshipCore
   - `AirshipCore.xcframework` : Push messaging features including channels, tags, named user and default actions (required)
   - `AirshipMessageCenter.xcframework` : Message center
   - `AirshipAutomation.xcframework` : Automation and in-app messaging
   - `AirshipPreferenceCenter.xcframework` : Preference Center
   - `AirshipFeatureFlags.xcframework` : Feature Flags
   - `AirshipObjectiveC.xcframework` : Objective-C Bindings
   - `AirshipDebug.xcframework` : Debugging tools
   - `AirshipNotificationServiceExtension.xcframework` : Service Extension framework (only for Notification Service Extensions)*

3. Add XCFrameworks to your project:
   - Open your project in Xcode
   - Click on your project in the Project Navigator
   - Select your target
   - Make sure the General tab is selected
   - Scroll down to **Frameworks, Libraries, and Embedded Content**
   - Drag in desired XCFrameworks from the downloaded SDK. They are wired up automatically as dependencies of your target

4. Verify Build Settings:
   - `Enable Modules` should be set to `Yes`
   - `Link Frameworks Automatically` should be set to `Yes`

![Install and Set Up the Apple SDK](https://www.airship.com/docs/images/enable-modules_hu_f56ed603b2699427.webp)
![Install and Set Up the Apple SDK](https://www.airship.com/docs/images/link-frameworks-automatically_hu_e08f4e14a1a2ca09.webp)

5. Import the frameworks in your code. Import statements match the framework names:

```swift
import AirshipCore
import AirshipMessageCenter
import AirshipAutomation
```





## Initialize Airship

The Airship SDK requires only a single entry point, known as *takeOff*. For UIKit apps, initialize during the application delegate's `application(_:didFinishLaunchingWithOptions:)` method. For SwiftUI apps, you can initialize in the App's `init()` method.

Before calling `takeOff`, configure the following:

- **Project Credentials**: Airship requires your project's [App Key](https://www.airship.com/docs/reference/glossary/#app_key) and [App Secret](https://www.airship.com/docs/reference/glossary/#app_secret)to authenticate your application. To find them, select the dropdown menu () next to your project name, and then **Project details**. You need separate credentials for development and production environments.

  On iOS, this is necessary because Apple provides separate APNS (Apple Push Notification Service) environments:
  - **Development/Sandbox**: Used for testing and development builds
  - **Production**: Used for App Store and TestFlight builds

  The SDK automatically selects the correct credentials based on your build configuration. Configure both sets of credentials in your code, and use the `#if DEBUG` conditional to switch between environments.

- **Cloud Site**: Airship config defaults to the US cloud site. If your application is set up for the EU site, set the site on the config options to `.eu`.

### Calling takeOff

The following examples show how to configure and call `takeOff` programmatically. Alternatively, you can configure Airship using an `AirshipConfig.plist` file—see [Advanced Integration](https://www.airship.com/docs/developer/sdk-integration/apple/installation/advanced-integration/#configuring-airship-via-plist-file) for details.


#### Swift



```swift
import SwiftUI
import AirshipCore

@main
struct MyApp: App {
    init() {
        var config = AirshipConfig()

        // Set credentials
        config.productionAppKey = "YOUR PRODUCTION APP KEY"
        config.productionAppSecret = "YOUR PRODUCTION APP SECRET"
        config.developmentAppKey = "YOUR DEVELOPMENT APP KEY"
        config.developmentAppSecret = "YOUR DEVELOPMENT APP SECRET"

        // Set cloud site (.us or .eu)
        config.site = .us

        #if DEBUG
        config.inProduction = false
        config.isAirshipDebugEnabled = true
        #else
        config.inProduction = true
        #endif

        try! Airship.takeOff(config)
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
```


For **UIKit** apps, call `takeOff` in your `AppDelegate`'s `application(_:didFinishLaunchingWithOptions:)` method instead of the App's `init()`.



#### Objective-C


```objective-c
@implementation AppDelegate

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

    UAConfig *config = [UAConfig config];

    // Set credentials
    config.productionAppKey = @"YOUR PRODUCTION APP KEY";
    config.productionAppSecret = @"YOUR PRODUCTION APP SECRET";
    config.developmentAppKey = @"YOUR DEVELOPMENT APP KEY";
    config.developmentAppSecret = @"YOUR DEVELOPMENT APP SECRET";

    // Set cloud site (UACloudSiteUS or UACloudSiteEU)
    config.site = UACloudSiteUS;

    #if DEBUG
    config.inProduction = NO;
    config.isAirshipDebugEnabled = YES;
    #else
    config.inProduction = YES;
    #endif

    NSError *airshipError;
    [UAirship takeOff:config error:&airshipError];
    NSAssert(airshipError == nil, @"TakeOff failed %@", airshipError);

    return YES;
}

@end
```




The Airship SDK automatically integrates with your app by default, so you don't need to implement push-related `UIApplicationDelegate` or `UNUserNotificationCenterDelegate` methods. This works for most applications out of the box. For advanced use cases or to disable automatic integration, see the [Advanced Integration](https://www.airship.com/docs/developer/sdk-integration/apple/installation/advanced-integration/##manual-integration) guide.

## Test the integration

After completing the setup, verify your integration:

1. **Build and run your app** in Xcode
2. **Check the console logs** for Airship channel creation:
   - Look for a log message: `Channel ID: <CHANNEL_ID>`
   - The channel ID will be displayed in the console output
   - For more detailed logging, see [Logging](https://www.airship.com/docs/developer/sdk-integration/apple/installation/logging/)

If you see the channel ID in the console logs and no errors, your integration is successful. You can now proceed with configuring [deep links](https://www.airship.com/docs/developer/sdk-integration/apple/deep-links/), [push notifications](https://www.airship.com/docs/developer/sdk-integration/apple/push-notifications/getting-started/), and other Airship features.

If you don't see a channel ID in the console logs or encounter errors during initialization, see [Troubleshooting Initialization](https://www.airship.com/docs/developer/sdk-integration/apple/troubleshooting/initialization/) for common problems and solutions.
