Canceled but Still Charged? A StoreKit 2 Entitlement Audit That Saves Support Tickets
Photo: developer testing subscription app on iPhone with code on laptop, StoreKit debug screen, software testing workspace, via assets.chalkie.ai
A subscription support ticket is usually a trust problem wearing a billing costume. The customer says they canceled. The app still shows a shiny “Pro” badge. The bank statement says another charge landed. Nobody in the thread is lying, exactly — the app is just presenting stale or incomplete StoreKit state as if it were the whole truth.
As of this December, StoreKit 2 gives Swift developers enough signal to avoid most of these messes. The catch is that the signal is spread across transaction listeners, renewal info, pending purchases, revocation dates, and server-side notifications. If your entitlement layer only checks an expiration date and a local Boolean, you are going to lose arguments with customers you cannot see.
This audit is not about adding another paywall SDK. It is about making the app’s subscription story match reality closely enough that support can stop playing detective.
Start With the State You Actually Trust
The first question is simple: where does your app decide that someone is entitled? If the answer is UserDefaults, a receipt file, or a custom flag set after purchase, that is the audit’s first red flag. StoreKit 2’s verified transactions should be the source of truth, with your backend as a corroborating record when you have one.
The second question: when does that state get refreshed? A paywall screen that checks entitlement only when it appears will miss renewals, refunds, and revocations that happen while the app is backgrounded. A transaction listener started at launch is the baseline. It should not be tied to the paywall’s lifecycle, and it should not stop when the user dismisses a sheet.
A compact listener looks like this:
updatesTask = Task {
for await result in Transaction.updates {
await handle(result)
}
}
That handle method should verify the result, update your entitlement cache, and finish the transaction when appropriate. If the listener only exists on the settings screen, you have built a subscription app with a part-time memory.
The Four Places Entitlement State Goes Rotten
Most “I canceled but I’m still charged” tickets trace back to one of four gaps.
1. The listener starts too late, or never
If the app launches, restores state, and only then starts listening, there is a window where renewals or revocations can arrive unobserved. Start the listener early, keep the task alive, and handle unfinished transactions. Also refresh current entitlements when the app returns to the foreground. Foreground refresh is not glamorous, but it catches the cases where the user changed something in Settings while your app was asleep.
2. Renewal info is ignored
An expiration date in the future does not mean auto-renew is on. Product.SubscriptionInfo.RenewalInfo can tell you whether the subscription will auto-renew, whether it is in billing retry, and whether a grace period is active. If your UI says “Active” while the renewal info says billing retry, the customer sees a charge and your app sees a subscriber. Both can be technically true, and both can be confusing.
Show the difference. “Active until March 12, auto-renew off” is a much better sentence than “Subscribed.” If billing retry is active, say that the store is trying to renew the subscription. Do not make the customer infer it from a bank alert.
3. Pending purchases are treated as success
Ask to Buy is a gift to support teams. A purchase can sit in .pending while a parent or guardian decides. If your code grants entitlement on .pending, you have created a free trial with extra steps. Keep pending purchases in a pending state, show a clear message, and let the transaction listener update the UI when approval or decline arrives.
4. Refunds and revocations are invisible
A refunded transaction can still have an expiration date in the future. If you only look at expiration, the entitlement remains. Check revocationDate and treat a revoked transaction as inactive right away. This is also where App Store Server Notifications earn their keep. The app should not be the only witness to a refund.
Sandbox Is a Different Planet
Sandbox testing is necessary, but it is not a rehearsal for production in every detail. Renewals happen faster. Ask to Buy testers behave differently. Billing retry and grace periods are hard to reproduce on demand. StoreKit configuration files are great for UI work, but they will not tell you how your app behaves when the network drops mid-purchase or when a refund lands while the app is closed.
Build a small device-side probe and run it against a real sandbox account. Dump current entitlements, renewal info, pending transactions, and transaction history on one debug screen. Do not ship it to production, but do put it behind a TestFlight-only flag so support and QA can see what the app sees.
A minimal probe can start with this:
func snapshot() async {
for await result in Transaction.currentEntitlements {
switch result {
case .verified(let tx):
print(tx.productID, tx.expirationDate as Any, tx.revocationDate as Any)
case .unverified(_, let error):
print(error)
}
}
}
Add renewal info next, then pending transactions. The goal is not a beautiful dashboard. The goal is a shared vocabulary for support: “The app sees a revoked transaction” is a different ticket from “The app sees an active subscription with auto-renew off.”
A Diagnostic Checklist for Support
Run this before every subscription-heavy release:
- Does
Transaction.updatesstart at launch and stay alive? - Is entitlement derived from verified transactions, not a local Boolean?
- Does the UI distinguish active, auto-renew off, billing retry, grace period, pending, and revoked?
- Are pending Ask to Buy purchases shown as pending instead of active?
- Do refunds and revocations remove entitlement immediately?
- Is renewal info refreshed after purchase and on foreground?
- Does the app handle restore purchases without duplicating entitlements?
- Are sandbox and production states logged without leaking personal data?
- Can support see the same entitlement state the app sees?
- Do you have a test path for Ask to Buy approval and decline?
- Are App Store Server Notifications wired up if your backend grants access?
The Ticket You Want to Prevent
The classic ticket is not always a bug. A customer cancels auto-renew, then sees a charge for the current period. That charge can be correct. But if the app still says “Subscribed” with no explanation, the customer reasonably concludes that cancellation failed. Your UI created the ticket.
The fix is editorial as much as technical: explain the billing period, show whether auto-renew is on, and make pending or retry states visible. StoreKit 2 gives you the words. Use them before support has to translate.
Audit the entitlement path once per release, keep the debug probe close, and test the ugly states on a real device. The best subscription support ticket is the one your app prevents by telling the truth in the first place.