Troubleshooting Initialization

Troubleshoot common initialization issues and apply solutions.

When following steps in Getting Started or Advanced Integration, if you don’t see a channel ID in the console logs or encounter errors during initialization, review the following common problems and solutions.

takeOff errors

The takeOff method throws an error in these cases:

  • takeOff has already been successfully called.
  • takeOff was called without an AirshipConfig instance and the SDK could not load or parse AirshipConfig.plist.
  • takeOff was called without an AirshipConfig instance and the parsed AirshipConfig.plist is invalid due to missing credentials.
  • takeOff was called with an AirshipConfig instance that has an invalid config due to missing credentials.

takeOff called multiple times

If takeOff throws because it has already been successfully called, verify the following:

  • takeOff is only called once per app launch
  • It’s not called in both application(_:didFinishLaunchingWithOptions:) and your App’s init() method
  • For SwiftUI apps, takeOff is called only in the App’s init() method

takeOff credentials

The takeOff method only validates that credentials are present and formatted correctly. It does not verify that the credentials are valid against Airship servers. If the config is properly set up and Airship is only called once, no error will be thrown even if the credentials themselves are invalid.

The credentials used by takeOff are your Airship project’s App KeyThe unique identifier for your Airship project. It is used to authenticate the application for API calls. and App SecretA secret used to authorize requests for low-security API calls. It is intended to be embedded in your distributed application, and as such is limited in what it can do.. To find them, select the dropdown menu () next to your project name, and then Project details.

Symptoms of missing or invalid credentials:

  • No channel ID appears in the console logs
  • Warnings or errors in the logs after initialization
  • Channel is not created in the Airship dashboard

If you are experiencing credential issues, do the following:

  1. Compare your Airship project credentials with the values in your app, either in code or in AirshipConfig.plist.
    • Credentials must match the expected format and character set.
    • Credentials must not be empty strings or contain extra whitespace.
  2. Ensure both productionAppKey/productionAppSecret and developmentAppKey/developmentAppSecret are set before calling takeOff.

Guidelines for credentials:

  • Use development credentials for development builds and production credentials for release and TestFlight builds.
  • Configure both development and production credentials in your app, either in code or in AirshipConfig.plist. The SDK chooses which to use based on your build configuration.

AirshipConfig.plist not found or invalid

If takeOff fails because the SDK could not load or parse AirshipConfig.plist, or the plist is invalid, verify the following:

  • The file exists in your app bundle
  • The file is included in your target’s Copy Bundle Resources build phase
  • All required keys are present in the plist file: productionAppKey, productionAppSecret, developmentAppKey, and developmentAppSecret
  • The plist file format is valid XML