iOS Subscriptions Are Hard
Recurring iOS subscriptions are a different problem from one-off in-app purchases. A single purchase is a transaction the user starts and finishes. A subscription is a transaction the user starts once and then renews automatically, often without opening the app. StoreKit was built around the first model, so the developer has to fill the gap for the second. This guide compares the two practical approaches — handling receipts on the device and handling them on a server — and gives a decision checklist for what to build first.
What StoreKit Assumes, and What Subscriptions Break
StoreKit's queue and receipt mechanism assumes a transactional, user-driven purchase. For subscriptions, only the first purchase fits that shape. After that, renewals arrive on their own schedule, and an SKPaymentTransaction can appear on the StoreKit queue without any user action. That unprompted appearance is the source of most of the difficulty. Users switch devices, receipts go stale, and transactions can go unhandled. Each of those cases has to be considered before a paying user can reliably receive their content.
The practical consequence is that subscription status is not a single event you handle once. It is a state that can change at any time, and every screen that depends on it has to cope with that change.
Two Approaches: Device-Side and Server-Side
There are two ways to handle subscriptions in an iOS app. The first is to do everything on the device: run the normal in-app purchase flow, validate the receipt file on-device, store and track the latest expiration_date for each product locally, and handle renewal transactions as they appear. The second is to send the receipt to a server for validation, parsing, and storage, then return the result to the device.
Neither approach removes the renewal problem. The difference is where the receipt lives and how much of the subscription history you can see later.
Device-Side Subscription Handling, Step by Step
Purchasing a subscription product looks the same as purchasing any other in-app product, apart from the user interface copy. The difference is that subscription products renew, generating unsolicited transactions on the StoreKit queue later, and their receipt data includes an expiration_date field. That field is what tells you which products or services the user is entitled to.
To protect against in-app purchase piracy and to read a user's transaction history, you validate the App Store receipt. Apple does not provide built-in methods for verifying a receipt file; the stated reason is that built-in methods would become a target for in-app purchase crackers. The code for verifying a receipt on the device is not trivial.
Once the receipt is unpacked, the useful value is the latest expiration_date. You find it by looping through all in-app purchase records in the receipt and taking the latest expiration_date field, then caching it, usually in NSUserDefaults or something similar.
Renewals are where device-side handling most often goes wrong. In a standard in-app purchase flow, you only need to watch the payment queue while the user is completing a purchase. With subscriptions, a renewal can arrive at any time, so the app has to be ready to handle it from anywhere. The appropriate response is to validate the receipt as soon as the transaction appears on the StoreKit queue and update the user's entitlements. That is harder than it sounds: if the app has an account system, what happens when a renewal arrives while nobody is logged in? What happens when it arrives in the middle of a flow that depends on the subscribed state? Each of those cases has to be designed for.
Where Device-Only Handling Falls Short
Device-side receipt handling makes a few important things difficult or impossible.
First, subscription status is trapped on the device. If the service ever expands beyond the current app, the existing subscription state has to be extracted and moved, which is an elaborate escape plan rather than a simple query.
Second, business performance is hard to understand. Apple's dashboards are fully anonymized. Aggregate metrics can give a bird's-eye view, but user-by-user questions quickly become unanswerable from those dashboards alone.
Third, and most consequential, the app is at the mercy of the StoreKit queue. A hiccup in your code or in StoreKit can mean a transaction is missed, which can deprive a paying customer of service. With device-only handling, debugging and remediating that situation is difficult.
Server-Side Subscription Handling
With a server, the device still runs the normal in-app purchase flow, but the receipt is sent over HTTP to a server where it is validated, parsed, and stored, and the resulting data is returned to the device. The server response is stored on the device. Renewal handling on the device becomes semi-optional, because the server can keep status current.
Sending the receipt to a server has two significant advantages. You can use Apple's /verifyReceipt endpoint, which saves a lot of time and returns something device-side validation cannot: a list of the most recent transactions. And you can keep the receipt file server-side to act as a refresh token for the user's subscription status. When you parse a receipt on the device, whatever transactions are in the file are all you get. With /verifyReceipt, Apple returns the most up-to-date subscription transactions, and the receipt file becomes a fetch token for polling. That polling is essential for a complete subscription server.
Polling and Status Notifications
Keeping a user's subscription status current means polling the /verifyReceipt endpoint and using Apple's status update notifications. That adds real backend complexity: a job that checks receipts periodically and the ability to handle POSTs from Apple. It also raises a design question — how often should you poll?
For an active subscription the answer is relatively simple. You can start checking close to the renewal date, though doing only that will miss returns. The complexity arrives when a customer cancels. They may resubscribe at any point in the future. If they resubscribe inside your app, a new receipt can be sent and the backend updated. But a user can also resubscribe from the App Store settings page, and then only some combination of polling and status notifications gives you complete knowledge of their status.
What to Store Server-Side
What you store after validating a receipt depends on your needs, but more is generally better. The simplest implementation stores only the latest expiration_date, which gives a quick way to determine subscription status. That choice also cuts you off from much of the information a receipt provides. A better implementation stores the user's complete transaction history, which supports understanding average subscriber lifetimes, cancellations, and how the paying subscriber base changes day by day.
Metrics and Customer Support
Without a server holding receipts, good metrics are very difficult. Understanding lifetime value, and making decisions about user acquisition spending, requires knowing the dollar amount each user spends. Tracking total transaction history enables that. Event tracking services can record StoreKit transactions, but the result depends on app behavior, the user's device, and the third-party tracker. When you are trying to determine whether you are breaking even on ad spend, you want to eliminate systematic error, and event-based trackers carry a lot of it. A system that parses the full transaction history and attaches dollar values to each transaction gives the most accurate basis for monetization questions.
Customer support is the other major advantage. Developers lack programmatic access to a user's account history and cannot modify or cancel a subscription directly. Often the best available action is to tell the user how to contact Apple or how to manage the subscription in App Store settings. With a server, the user's entire history is accessible, which makes it much easier to understand what went wrong. In-app purchase transactions fail in strange ways, users get confused, and emotions run high when money is involved. Having the full subscription history at hand is a better starting point for resolving a ticket. With a server as the source of truth, you can also add support transactions to a user's history to grant a subscription for a chosen period. That requires backend work but can pay off in avoided one-star reviews.
Decision Checklist: What to Build First
Use this checklist to choose the first piece of subscription infrastructure to build.
- Does the app need to know subscription status on more than one device or surface? If yes, device-only storage will need an extraction plan later.
- Do you need per-user revenue figures, lifetime value, or ad-spend break-even analysis? If yes, a server that stores transaction history is the practical path.
- Do you need to resolve support tickets by inspecting a user's purchase history? If yes, server-side storage is the enabler.
- Can you commit to a periodic receipt-checking job and an endpoint that accepts Apple's status notifications? If not, plan for incomplete status knowledge after a cancellation.
- If you can only build one thing, build server-side receipt validation and store the receipt file. The receipt file is the foundation for everything else; if receipts are trapped on the device, later options are limited.
A useful worked example: a renewal arrives while no user is logged in. Device-side, the app has to decide whether to validate, where to cache the result, and how to reconcile it with the next login. Server-side, the receipt can be validated and stored against the account, and the device can pick up the server response when the user returns. The same event is handled once rather than re-litigated on every screen.
Frequently asked questions
Why does the receipt file matter if I already validate on the device?
A device-side parse only exposes the transactions present in the file. Sent to a server and checked with /verifyReceipt, the receipt file acts as a fetch token that returns the most up-to-date subscription transactions. Keeping it server-side is what makes later polling and status reconciliation possible.
What happens if a user resubscribes from App Store settings instead of in my app?
If the resubscription happens inside the app, a new receipt can be sent and the backend updated. If it happens from App Store settings, the app will not see it directly. Complete status knowledge then depends on some combination of polling /verifyReceipt and Apple's status update notifications.
Is storing only the latest expiration_date enough?
It is the simplest implementation and gives a quick status check, but it discards most of the information in the receipt. Storing the complete transaction history is what supports subscriber lifetime analysis, cancellation analysis, and day-by-day changes in the paying base.
Does Apple provide a built-in way to verify a receipt on the device?
No. Apple does not provide built-in methods for verifying a receipt file, on the stated grounds that such methods would become a target for in-app purchase crackers. The verification code has to be written by the developer, and it is not trivial.