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:
takeOffhas already been successfully called.takeOffwas called without anAirshipConfiginstance and the SDK could not load or parseAirshipConfig.plist.takeOffwas called without anAirshipConfiginstance and the parsedAirshipConfig.plistis invalid due to missing credentials.takeOffwas called with anAirshipConfiginstance 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:
takeOffis only called once per app launch- It’s not called in both
application(_:didFinishLaunchingWithOptions:)and your App’sinit()method - For SwiftUI apps,
takeOffis called only in the App’sinit()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:
- 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.
- Ensure both
productionAppKey/productionAppSecretanddevelopmentAppKey/developmentAppSecretare set before callingtakeOff.
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, anddevelopmentAppSecret - The plist file format is valid XML