1 min read

Airship

Last Updated - Platform 20.0.0 - SDK 15.0.0

The PoqAirship integrations wraps the Airship SDK allowing it to be plugged into the PoqSDK to enable remote notifications and analytics through Airship.

Capabilities

NotificationsPush notifications to your audience through Airship or via the Poq CMS.
AnalyticsA small subset of analytics events are sent to Airship to allow targeted push notifications.

Add Airship to your App

https://github.com/poqcommerce/Poq.iOS.Airship.git
PoqAirship from version 7.0.0

  1. Make sure the Airship dashboard is set up.
  2. Using the information above, add the package to your project.
  3. Import the integration in your AppDelegate.swift.
import PoqAirship
  1. Register the module using your AppsFlyer dev key.
override func setupModules() {
PoqPlatform.shared.addModule(PoqAirship())
}

You have set up Airship.

Set up Airship

Now that the app includes PoqAirship we need to set it up. Let's start by retrieving a key from Apple.

  1. Head to the Apple Developer portal.
  2. Log in and make sure to select your companies account (if you have multiple).
  3. Navigate to Certificates, Identifiers & Profiles then to Keys.
  4. Press the + to add a new Key (if you do not see this you may not have the right roles).
  5. Type a name to describe the key such as 'Airship'.
  6. Select Apple Push Notifications service (APNs).
  7. Press Continue then Register.
  8. Press Download and make sure to read the warning (you could save the key in 1pass or just regenerate in the future).

Now we need to upload the key to Airship.

  1. Head to the Airship portal and log in.
  2. Create a Live app or select your existing Live app.
  3. Navigate to Settings > Channels.
  4. Next to iOS tap Add (or Edit) then expand Token-based Authentication.
  5. Press Choose file and select the key you downloaded earlier.
  6. Enter your Team ID, Bundle ID, and Key ID (you can find these on the Apple portal).
  7. Press Add iOS (or Update iOS) to save.

Set up your App

Finally, we need to configure the app with an AirshipConfig.plist.

  1. Make sure that your app has the Push Notifications capability enabled in the Apple Developer portal and your Xcode project. You will need to regenerate your provisioning profiles to include the capability.
  2. Add a new Empty file to your project and name it AirshipConfig (leave the extension off for now).
  3. Copy paste the following into your new file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>developmentAppKey</key>
<string></string>
<key>developmentAppSecret</key>
<string></string>
<key>productionAppKey</key>
<string>replace</string>
<key>productionAppSecret</key>
<string>replace</string>
</dict>
</plist>
  1. Head back to the Airship portal.
  2. Navigate to your Live app then Settings > APIs & Integrations.
  3. Copy the App Key into the new file's productionAppKey value.
  4. Copy the App Secret into the new file's productionAppSecret value.
  5. Rename the file to AirshipConfig.plist.

You have set up Airship.