App Store subscription tracking
Этот контент еще не доступен на вашем языке.
Integration overview
Anchor link toApp 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 toSource: App Store Server Notifications are sent from Apple to Pushwoosh.
Synchronized event
Anchor link to| Event name | Description | Attributes |
|---|---|---|
PW_SubscriptionCancel | Fired 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- A user disables auto-renewal for their subscription in the App Store.
- Apple sends an App Store Server Notification (V2) to your Pushwoosh notification URL.
- Pushwoosh decodes the signed payload and reads the
appAccountTokenfrom the transaction. - Pushwoosh looks up the device whose HWID matches that token, finds the user bound to it, and posts the
PW_SubscriptionCancelevent for that user.
Use case: Win back churning subscribers
Anchor link toA 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 toSet appAccountToken to the device’s Pushwoosh HWID
Anchor link toPushwoosh 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 appAccountTokenvar options: Set<Product.PurchaseOption> = []if let hwid = UIDevice.current.identifierForVendor { options.insert(.appAccountToken(hwid))}
let result = try await product.purchase(options: options)// applicationUsername must be a UUID string to populate appAccountTokenlet payment = SKMutablePayment(product: product)payment.applicationUsername = UIDevice.current.identifierForVendor?.uuidStringSKPaymentQueue.default().add(payment)Find your Pushwoosh Application Code
Anchor link toOpen 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- In App Store Connect, go to Apps → your app → App Information (under General), and scroll to App Store Server Notifications.
- Select Version 2 notifications.
- Set both the Production Server URL and the Sandbox Server URL to:
https://appstore-notifications.pushwoosh.com/appstore/YOUR_APPLICATION_CODE/- Replace
YOUR_APPLICATION_CODEwith the Application Code from the previous step. Keep the trailing slash.
Confirm the event in Pushwoosh
Anchor link toWhen 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 toCreate 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.
Testing
Anchor link toApp Store Server Notifications can be triggered in Apple’s Sandbox environment. To verify the integration:
- Make a sandbox subscription purchase with
appAccountTokenset as described above. - Disable auto-renewal from the device’s subscription management screen.
- In Pushwoosh Control Panel, open the user profile and go to Events history.
- Confirm that
PW_SubscriptionCancelappears within a few moments.