انتقل إلى المحتوى

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 cancellations without building your own backend infrastructure. When a user turns off auto-renewal for a subscription in their App Store account, Apple notifies Pushwoosh, and Pushwoosh fires a PW_SubscriptionCancel event on the matching user profile.

Integration type

Anchor link to

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

Synchronized event

Anchor link to
Event nameDescriptionAttributes
PW_SubscriptionCancelFired when a user turns off auto-renewal for an App Store subscription.productID — the App Store product identifier of the canceled subscription.

How it works

Anchor link to
  1. A user disables auto-renewal for their subscription in the App Store.
  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 PW_SubscriptionCancel event for that user.

Use case: Win back churning subscribers

Anchor link to

A cancellation is rarely instant. A user who disables auto-renewal keeps their subscription until the end of the paid period. That window is your best chance to win them back.

With the PW_SubscriptionCancel event, you can launch a Customer Journey the moment auto-renewal is turned off. Send a push notification with a retention offer, follow up with an email highlighting features the user would lose, or show an in-app message with a discount on their next renewal. You can reach users before the subscription actually lapses.

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 event in Pushwoosh

Anchor link to

When Pushwoosh processes the first App Store notification, it registers PW_SubscriptionCancel in your project with a string attribute productID. After a sandbox test, open Audience → Events to verify the event appears. It is then ready for segmentation, statistics, and Customer Journeys.

Build your win-back campaign

Anchor link to

Create a Customer Journey with a trigger-based entry on the PW_SubscriptionCancel event, and add the messages you want to send to users who are about to churn.

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.
  2. Disable auto-renewal from the device’s subscription management screen.
  3. In Pushwoosh Control Panel, open the user profile and go to Events history.
  4. Confirm that PW_SubscriptionCancel appears within a few moments.