Enable App Store server notifications
The Adapty SDK reports purchases made in your app. Server notifications report changes that happen outside the app, for example:
- A subscription renews.
- A user turns off auto-renewal.
- A payment fails because of a billing issue.
- A subscription expires.
- A user requests a refund. Refund Saver answers the request.
- Apple refunds a purchase.
Enter the notification URL from Adapty in App Store Connect, then check that notifications reach Adapty.
Enter the notification URL in App Store Connect
If another server already receives notifications for your app, set up forwarding to it before you replace its URL.
-
In Adapty, open the app you’re connecting: each Adapty app has its own notification URL. Go to App settings > iOS SDK. In the App Store server notifications section, copy the URL from the URL for App Store server notifications field.
-
In App Store Connect, open the App Information page of your app.
-
In the App Store Server Notifications section, find Production Server URL. If a URL is already there, click Edit. Otherwise, click Set Up URL.
-
Paste the URL from Adapty, and click Save.
-
To have the notifications from your sandbox tests reach Adapty, repeat steps 3 and 4 for Sandbox Server URL.
Check that notifications reach Adapty
To confirm that notifications reach Adapty, make a sandbox purchase. Then review the status of the App Store server notifications section in Adapty. The purchase itself appears in Adapty even without notifications, because the SDK reports it. Once Apple sends a notification about the purchase, Adapty changes the status from Waiting to Active. A test notification from Apple doesn’t change the status.
The status then shows how long ago the last notification arrived:
- Active: Less than 24 hours ago.
- Delayed: 24 to 72 hours ago.
- Stalled: 72 hours ago or more.
Delayed and Stalled don’t always mean a broken setup: in an app with few subscribers, days can pass without a notification. Active only shows that notifications arrive at the URL.
To make sure the notifications are about your app, verify the setup:
- In App Store Connect, open the App Information page of your app.
- Make sure that Production Server URL and Sandbox Server URL both match the URL in Adapty.
- Make another sandbox purchase, and confirm that the status reads Active.
Share notifications with another server
If another server needs the notifications from Apple too, Adapty can forward them to that server. In Adapty, go to App settings > iOS SDK. In the App Store server notifications section, enter the URL of that server in the URL for forwarding raw Apple events field, and click Save.
Adapty forwards the notifications it receives from Apple to the other server. If you enter the notification URL from Adapty under Sandbox Server URL in App Store Connect, Adapty forwards sandbox notifications too. The forwarded body keeps the signed payload from Apple unchanged, so the other server can verify the signature. Adapty doesn’t pass on the request headers from Apple.
Adapty doesn’t forward:
- Purchases that the SDK reports without a notification from Apple.
- A test notification from Apple.
- A notification that Adapty already received within the last hour.
To prevent a loop, don’t post forwarded notifications back to the notification URL. Don’t enter an Adapty URL in the URL for forwarding raw Apple events field either.
If your backend must keep its URL in App Store Connect, pass the notifications to Adapty from your backend instead.
Notification authenticity
Treat the notification URL as a credential. Adapty identifies the app by the URL alone, so anyone who has the URL can post a payload to it.
A test notification never creates an event in the Event Feed, whoever sends it.
What’s next
Set up the Adapty SDK for:
Then make a sandbox purchase to check that notifications reach Adapty.