Skip to content

App Store subscription tracking

Integration overview

Anchor link to

App Store Server Notifications is Apple’s server-to-server service that sends your backend a real-time message whenever a subscription’s status changes.

By connecting App Store Server Notifications to Pushwoosh, you can react to the entire subscription lifecycle, including purchases, renewals, cancellations, billing problems, expirations, and refunds — without building your own backend infrastructure. Whenever a subscription’s status changes in a user’s App Store account, Apple notifies Pushwoosh, and Pushwoosh fires the matching PW_Subscription* event on the user profile.

Integration type

Anchor link to

Source: App Store Server Notifications are sent from Apple to Pushwoosh.

Tracked events

Anchor link to

Pushwoosh maps every supported App Store notification to a unified PW_Subscription* event set, so you can trigger campaigns on any stage of the subscription lifecycle.

EventFires when
PW_SubscriptionStartA user buys the subscription for the first time.
PW_SubscriptionRenewThe subscription auto-renews for a new billing period.
PW_SubscriptionCancelA user turns off auto-renewal. The subscription stays active until it expires.
PW_SubscriptionResumeA user re-enables auto-renewal, or resubscribes before the subscription lapses.
PW_SubscriptionBillingIssueA renewal payment fails and the subscription enters Apple’s billing retry period.
PW_SubscriptionRecoveredA previously failed renewal goes through and the subscription is active again.
PW_SubscriptionExpiredThe subscription has fully lapsed and is no longer active.
PW_SubscriptionRefundApple refunds the purchase or revokes access.

Every event carries the same attributes:

  • productID: the App Store product identifier of the subscription.
  • expiresAt: when the current paid period ends, as a Unix timestamp in seconds. Included when Apple provides it.
How events map to App Store Server Notifications

For developers verifying the integration, each Pushwoosh event corresponds to these App Store notificationType (and subtype) values:

Pushwoosh eventnotificationType / subtype
PW_SubscriptionStartSUBSCRIBED / INITIAL_BUY
PW_SubscriptionRenewDID_RENEW
PW_SubscriptionCancelDID_CHANGE_RENEWAL_STATUS / AUTO_RENEW_DISABLED
PW_SubscriptionResumeDID_CHANGE_RENEWAL_STATUS / AUTO_RENEW_ENABLED, SUBSCRIBED / RESUBSCRIBE
PW_SubscriptionBillingIssueDID_FAIL_TO_RENEW
PW_SubscriptionRecoveredDID_RENEW / BILLING_RECOVERY
PW_SubscriptionExpiredEXPIRED
PW_SubscriptionRefundREFUND, REVOKE

Other notification types, such as price increases, plan changes, on-hold, and consumption requests, are acknowledged but don’t post an event.

How it works

Anchor link to
  1. A subscription’s status changes in a user’s App Store account (a purchase, renewal, cancellation, and so on).
  2. Apple sends an App Store Server Notification (V2) to your Pushwoosh notification URL.
  3. Pushwoosh decodes the signed payload and reads the appAccountToken from the transaction.
  4. Pushwoosh looks up the device whose HWID matches that token, finds the user bound to it, and posts the matching PW_Subscription* event for that user.

Win back churning subscribers: Disabling auto-renewal doesn’t end access right away. The subscription stays active until the paid period ends, and that’s your window to win the user back. On PW_SubscriptionCancel, launch a Customer Journey with a retention push, an email about features they’d lose, or an in-app message with a renewal discount before access lapses.

Onboard new subscribers: Trigger a welcome series on PW_SubscriptionStart to help users get value from their plan early and set the stage for renewal.

Rescue failed payments: When PW_SubscriptionBillingIssue fires, a renewal payment didn’t go through and the subscription is in Apple’s retry window. Prompt the user to update their payment method before they lose access, and follow up with PW_SubscriptionRecovered to confirm once it’s resolved.

Re-engage lapsed users: Start a reactivation campaign on PW_SubscriptionExpired with a returning-customer offer for subscribers who have fully churned.

Setting up the integration

Anchor link to

Set appAccountToken to the device’s Pushwoosh HWID

Anchor link to

Pushwoosh identifies the right user from the device’s HWID, so your app must attach the device’s Pushwoosh HWID as the appAccountToken when the subscription is purchased through StoreKit.

By default, the Pushwoosh iOS SDK uses the device’s identifierForVendor (IDFV) as the HWID. IDFV is already a UUID, exactly the format Apple requires for appAccountToken. Pushwoosh then resolves the user currently bound to that device automatically, so this works whether or not you assign your own User IDs with setUserId.

// Attach the device's Pushwoosh HWID (the default IDFV) as the appAccountToken
var options: Set<Product.PurchaseOption> = []
if let hwid = UIDevice.current.identifierForVendor {
options.insert(.appAccountToken(hwid))
}
let result = try await product.purchase(options: options)

Find your Pushwoosh Application Code

Anchor link to

Open your application in the Pushwoosh Control Panel. Your Application Code (format XXXXX-XXXXX) is shown below the project name in the sidebar.

You’ll need the Application Code to build the notification URL.

Add the notification URL in App Store Connect

Anchor link to
  1. In App Store Connect, go to Apps → your app → App Information (under General), and scroll to App Store Server Notifications.
  2. Select Version 2 notifications.
  3. Set both the Production Server URL and the Sandbox Server URL to:
https://appstore-notifications.pushwoosh.com/appstore/YOUR_APPLICATION_CODE/
  1. Replace YOUR_APPLICATION_CODE with the Application Code from the previous step. Keep the trailing slash.

Confirm the events in Pushwoosh

Anchor link to

Pushwoosh registers each PW_Subscription* event in your project the first time it occurs, with the productID and expiresAt attributes. After a sandbox test, open Audience → Events to verify the events appear. They are then ready for segmentation, statistics, and Customer Journeys.

Build your campaign

Anchor link to

Create a Customer Journey with a trigger-based entry on any PW_Subscription* event, for example PW_SubscriptionCancel for win-back or PW_SubscriptionStart for onboarding, and add the messages you want to send.

App Store Server Notifications can be triggered in Apple’s Sandbox environment. To verify the integration:

  1. Make a sandbox subscription purchase with appAccountToken set as described above. This fires PW_SubscriptionStart.
  2. Disable auto-renewal from the device’s subscription management screen. This fires PW_SubscriptionCancel.
  3. In Pushwoosh Control Panel, open the user profile and go to Events history.
  4. Confirm that the events appear within a few moments.