ARTICLE AD BOX
I find StoreKit 2 confusing, specifically around detecting subscription expiry and renewal.
My goal is simple: maintain a Boolean that reflects whether the user currently has an active subscription entitlement.
/// Indicates whether the user has an active subscription entitlement. var isSubscribed = falseExpected Behaviour
The user downloads the app from the App Store.
The user performs actions that require a subscription.
The user is prompted to subscribe and completes the purchase.
isSubscribed = trueFor testing purposes, the subscription duration is very short (e.g. five minutes).
The user cancels auto-renewal immediately.
When the subscription expires, the user should no longer be able to perform paid actions.
isSubscribed = falseTest Setup
I am testing using StoreKit Transactions Manager in Xcode:
Scheme > Options > StoreKit Configuration → AppName.storekit
Editor > Subscription Renewal Rate → Any Renewal Every 30 seconds
What I Did
1. Launch the app.
2. Attempt a paid action.
3. Subscribe when prompted.
4. Open StoreKit Transactions Manager.
5. Select Subscription Options → Cancel Subscription (expecting no further renewal).
6. Wait one to two minutes.
What I Expected
I expected Transaction.updates to notify me that the subscription had expired, at which point I would set:
isSubscribed = falseWhat Actually Happens
The subscription is cancelled and does not auto-renew.
The renewal period expires.
However, the app still allows paid actions indefinitely.
Transaction.updates does not appear to emit an update indicating expiration.
From the app’s point of view, the subscription seems to remain valid.
My Question
How am I supposed to detect when a subscription has actually expired using StoreKit 2?
More specifically:
Is Transaction.updates expected to emit an event on expiration?
Should I be querying Product.SubscriptionInfo.Status instead of relying on transactions?
Am I misunderstanding how cancellation vs expiration works in StoreKit 2?
What is the recommended way to keep isSubscribed in sync with the current entitlement state?
At the moment, it appears that a user can cancel auto-renewal, let the subscription expire and still continue using paid features indefinitely.
What is the correct pattern for handling this?
