Skip to main content

Airship

👍Pro Integration

The Airship integration is available to all users signed up after September '23, the legacy Grow and Pro plans, and Enterprise plans. If you're on a legacy Free or Starter plan and want to access this integration, migrate to our new pricing via your billing settings.

Airship can be a helpful integration tool in understanding what stage a customer is in and reacting accordingly. You can design and trigger personalized Airship messages to customers based on purchase behavior.

Use your RevenueCat events to send Custom Events to trigger messages with Airship. This means you can design personalized Airship Journeys and Automations based on purchase behavior.

With our Airship Integration, you can:

  • Send a message to a user whose subscription experienced a billing issue.
  • Send reminders to your app's message center when a user's trial is about to expire.

With accurate and up-to-date subscription data in Airship, you'll be set to turbocharge your users' engagement ⚡️

Integration at a Glance

Includes RevenueSupports Negative RevenueSends Sandbox EventsIncludes Customer AttributesSends Transfer EventsOptional Event Types
Requires Token and App keynon_subscription_purchase_event uncancellation_event``subscription_paused_event``expiration_event``billing_issue_event product_change_event

Events

The Airship integration tracks the following events:

Event TypeDefault Event NameDescriptionApp StorePlay StoreAmazonStripePromo
Initial Purchaserc_initial_purchase_eventA new subscription has been purchased.
Trial Startedrc_trial_started_eventThe start of an auto-renewing subscription product free trial.
Trial Convertedrc_trial_converted_eventWhen an auto-renewing subscription product converts from a free trial to normal paid period.
Trial Cancelledrc_trial_cancelled_eventWhen a user turns off renewals for an auto-renewing subscription product during a free trial period.
Renewalrc_renewal_eventAn existing subscription has been renewed or a lapsed user has resubscribed.
Cancellationrc_cancellation_eventA subscription or non-renewing purchase has been cancelled. See cancellation reasons for more details.
Uncancellationrc_uncancellation_eventA non-expired cancelled subscription has been re-enabled.
Non Subscription Purchaserc_non_subscription_purchase_eventA customer has made a purchase that will not auto-renew.
Subscription Pausedrc_subscription_paused_eventA subscription has been paused.
Expirationrc_expiration_eventA subscription has expired and access should be removed. If you have Platform Server Notifications configured, this event will occur as soon as we are notified (within seconds to minutes) of the expiration. If you do not have notifications configured, delays may be approximately 1 hour.
Billing Issuerc_billing_issue_eventThere has been a problem trying to charge the subscriber. This does not mean the subscription has expired. Can be safely ignored if listening to CANCELLATION event + cancel_reason=BILLING_ERROR.
Product Changerc_product_change_eventA subscriber has changed the product of their subscription. This does not mean the new subscription is in effect immediately. See Managing Subscriptions for more details on updates, downgrades, and crossgrades.

For events that have revenue, such as trial conversions and renewals, RevenueCat will automatically record this amount along with the event in Airship.

Setup

1. Set Airship User Identity

If you're using the Airship SDK, you can either send the channel ID to RevenueCat or set an Airship Named User to match the RevenueCat app user ID. The preferred method is to send the channel ID to RevenueCat. Either method you use will allow events sent from the Airship SDK and events sent from RevenueCat to be synced to the same user.

Set Airship User Identity Using Channel ID

Setting the Airship channel ID in RevenueCat is the preferred way for identifying users in Airship. Call setAirshipChannelID on the Purchases SDK to have RevenueCat use the channel ID to send events to Airship.

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

// Configure Purchases
Purchases.configure(withAPIKey: "public_sdk_key", appUserID: "my_app_user_id")

// Initialize Airship
Airship.takeOff(launchOptions: launchOptions)

// Set the Airship channel ID in Purchases
let channelID = Airship.channel.identifier
Purchases.shared.attribution.setAirshipChannelID(channelID)

// ...

return true
}

[Advanced Alternative] Set Airship User Identity Using Named Users

Setting the Airship channel ID in RevenueCat is preferred over using Named Users, even if you have a user authentication system. However, if you're already using Named Users in your Airship integration, you have the option to set the Named User in the Airship SDK as the same app user ID as RevenueCat. Ensure Named Users is enabled in your Airship dashboard.

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

// Configure Purchases
Purchases.configure(withAPIKey: "public_sdk_key", appUserID: "my_app_user_id")

// Initialize Airship
Airship.takeOff(launchOptions: launchOptions)

// Identify the user in Airship
Airship.contact.identify("my_app_user_id")

// ...

return true
}

2. Send RevenueCat Events to Airship

After you've set up the Purchase SDK and Airship SDK to have the same user identity, you can "turn on" the integration and configure the event names from the RevenueCat dashboard.

  1. Navigate to your app in the RevenueCat dashboard and choose 'Airship' from the integrations menu
  2. Add your Airship app key and token
  3. Select the location of your Airship cloud site
  4. Enter the event names that RevenueCat will send or choose the default event names
  5. Select whether you want sales reported as gross revenue (before app store commission), or after store commission and/or estimated taxes.

Airship configuration page

Sample Events

Below are sample JSONs that are delivered to Airship for each event type.

[
{
"occurred": "2022-08-17T22:24:09Z",
"user": {
"named_user_id": "ZYXWVUTSRQ"
},
"body": {
"name": "rc_initial_purchase_event",
"value": 5.051,
"properties": {
"id": "12345678-1234-1234-1234-123456789012",
"event_timestamp_ms": 1660775073781,
"app_user_id": "1234567890",
"aliases": [
"$RCAnonymousID:8069238d6049ce87cc529853916d624c"
],
"original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"product_id": "subscription.v0.monthly",
"period_type": "NORMAL",
"purchased_at_ms": 1660775049528,
"expiration_at_ms": 1660775464920,
"environment": "SANDBOX",
"entitlement_ids": [
"Pro"
],
"transaction_id": "GPA.1234-5678-9012-34567",
"original_transaction_id": "GPA.1234-5678-9012-34567",
"is_family_share": false,
"country_code": "BR",
"currency": "BRL",
"price_in_purchased_currency": 25.99,
"subscriber_attributes": {
"$ip": {
"value": "123.45.67.89",
"updated_at_ms": 1660764263545
},
"$gpsAdId": {
"value": "12345678-9012-3456-7890-123456789012",
"updated_at_ms": 1660760899175
},
"$fbAnonId": {
"value": "1234567890-1234-5678-9012-345678901234",
"updated_at_ms": 1660760899262
},
"$appsflyerId": {
"value": "1234567890123-1234567890123456789",
"updated_at_ms": 1660760899175
}
},
"store": "PLAY_STORE",
"takehome_percentage": 0.85,
"app_id": "1234567890"
}
}
}
]
[
{
"body": {
"name": "rc_non_subscription_purchase_event",
"properties": {
"aliases": [
"$RCAnonymousID:8069238d6049ce87cc529853916d624c"
],
"app_user_id": "1234567890",
"currency": "USD",
"entitlement_ids": [
"Pro"
],
"environment": "PRODUCTION",
"event_timestamp_ms": 1663031444913,
"id": "12345678-1234-1234-1234-123456789012",
"original_app_user_id": "1234567890",
"original_transaction_id": "123456789012345",
"period_type": "PROMOTIONAL",
"price_in_purchased_currency": 0,
"product_id": "rc_promo_subscription_lifetime",
"purchased_at_ms": 1663031444879,
"store": "PROMOTIONAL",
"subscriber_attributes": {
"$email": {
"updated_at_ms": 1663031444396,
"value": "firstlast@gmail.com"
}
},
"takehome_percentage": 1,
"transaction_id": "123456789012345"
},
"value": 9.99
},
"occurred": "2022-09-13T01:10:44Z",
"user": {
"named_user_id": "ZYXWVUTSRQ"
}
}
]