Skip to content
tezvyn:
Menu

App Store Server Notifications: Your Backend's Source of Truth

Source: developer.apple.comHardHow cards are made

App Store Server Notifications: Your Backend's Source of Truth

App Store Server Notifications are webhooks from Apple that tell your backend about subscription events like renewals or refunds. They are your server's source of truth for user entitlements, letting you grant or revoke access without relying on the client…

Why it exists

Client-side app state is unreliable. A user can be offline, use a jailbroken device, or manipulate local data. To reliably manage paid entitlements, you need a secure, out-of-band communication channel directly from the App Store to your server.

The mental model

Think of App Store Server Notifications as a direct, secure phone call from Apple's servers to your backend. When something important happens with a customer's subscription—they renew, their payment fails, they get a refund—Apple calls your server to let you know immediately, instead of relying on the customer's app to relay the message.

How it works

You provide a secure HTTPS endpoint on your server in App Store Connect. When a subscription event occurs for one of your users, Apple's servers send a POST request to your endpoint. The request body contains a JSON Web Signature (JWS) payload. Your server must parse this payload, verify its cryptographic signature using Apple's public key to confirm its authenticity, and then process the event, for example, by updating the user's subscription status in your database. Key notification types include SUBSCRIBED, DID_RENEW, EXPIRED, and REFUND.

When to use it

Always use server notifications if your app has any form of auto-renewing subscription or non-consumable in-app purchase. They are the only reliable way to keep your user entitlement system in sync with the App Store's records. This is critical for granting, extending, or revoking access to paid features.

When not to use it

There is virtually no scenario where you would choose not to use them for subscriptions. For simple, one-time consumable purchases where a user gets an immediate in-app benefit (like game currency), you might rely solely on client-side receipt validation for simplicity, but this is still less robust. For any recurring revenue model, they are non-negotiable.

One canonical example

A user's subscription is set to expire. Their credit card is charged successfully. Apple's servers send a DID_RENEW notification to your backend endpoint. Your server verifies the JWS signature, decodes the payload, identifies the user, and updates their subscription_expires_at date in your database to one month in the future. The user experiences no interruption in service. Later, if that user requests and receives a refund through Apple Support, your server gets a REFUND notification and can immediately revoke their access.

Interview question

For which of the following scenarios are App Store Server Notifications considered most critical for reliable entitlement management?

  • a.Updating a user's subscription status after their auto-renewing subscription successfully renews.Correct
  • b.Validating a purchase receipt directly on the client device to unlock premium features.
  • c.Displaying the user's current subscription expiration date within the app's UI.
  • d.Granting a user access to a one-time consumable item like a game booster.
Why?

The card explicitly states, "Always use server notifications if your app has any form of auto-renewing subscription" and highlights the DID_RENEW notification for this purpose. While client-side validation might be used for one-time consumables (Option D), it is less robust and not considered the most critical use case for server notifications.

Just read this? Test yourself on what you have been reading.

Read the original → developer.apple.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on ios — each one lists the topics its interview covers.

See open roles