Handle StoreKit Billing Retry Without Guessing Entitlement

A subscription renewal fails and the customer is in a grace period. Your app sees “billing problem” and locks the feature anyway. The billing message is true; the access decision is wrong.

Renewal state, verified access, and what you tell the customer are related but separate decisions. Start by preserving the states StoreKit actually provides.

Grace and retry are different access states

Apple explicitly documents inGracePeriod as entitled to service. Its failing-renewal testing guide distinguishes that from billing retry outside a grace period, where the subscription is not entitled.

Do not infer access from a generic “retrying payment” flag. Also do not use whether automatic renewal is enabled as a replacement for current access: turning off a future renewal does not necessarily end the period already purchased.

For a simple subscription group whose accepted products all unlock the same feature, a small policy can make these decisions explicit:

import Foundation
import StoreKit

enum SubscriptionAccess: Equatable { case active, inactive, needsVerification }
func classifyRenewalStates(
    _ states: [Product.SubscriptionInfo.RenewalState],
    hasUnverifiedEvidence: Bool
) -> SubscriptionAccess {
    if states.contains(.subscribed) || states.contains(.inGracePeriod) { return .active }
    let knownInactive: Set<Product.SubscriptionInfo.RenewalState> = [
        .expired, .revoked, .inBillingRetryPeriod,
    ]
    if hasUnverifiedEvidence || states.contains(where: { !knownInactive.contains($0) }) {
        return .needsVerification
    }
    return .inactive
}
func subscriptionAccess(
    statuses: [Product.SubscriptionInfo.Status],
    allowedProducts: Set<String>
) -> SubscriptionAccess {
    var states: [Product.SubscriptionInfo.RenewalState] = []
    var unverified = false
    for status in statuses {
        guard case .verified(let transaction) = status.transaction,
            case .verified = status.renewalInfo
        else {
            unverified = true
            continue
        }
        guard allowedProducts.contains(transaction.productID), !transaction.isUpgraded else {
            continue
        }
        states.append(transaction.revocationDate == nil ? status.state : .revoked)
    }
    return classifyRenewalStates(states, hasUnverifiedEvidence: unverified)
}

The adapter verifies both the transaction and renewal information before using the status, restricts products to the feature’s allowlist, ignores an upgraded transaction, and handles explicit revocation.

The state classifier is separated so its product rules can be exercised without constructing fake signed StoreKit transactions.

Evaluate the relevant set, not the first element

Apple’s subscription status property returns an array and can contain several statuses, including Family Sharing cases. One expired status should not override another verified status that grants the same feature.

This example answers only a Boolean-style feature-access question. If your subscription group has several service tiers, resolve the actual allowed tier and its features. Do not assume every product in a group provides interchangeable access.

Unknown future states and failed verification produce needsVerification unless another verified state already establishes access. That is an uncertainty state for the UI and reconciliation layer, not permission to treat unverified evidence as a purchase.

An error while fetching status must also stay distinct from a successfully fetched empty status array. Do not catch a network error, substitute [], and then confidently tell the customer they have never subscribed.

Reuse the entitlement store

Apple’s currentEntitlements documentation includes auto-renewable subscriptions that are subscribed or in a grace period. If your existing feature gate already uses a verified entitlement service, keep that service authoritative and use renewal information for the billing explanation.

Avoid adding a second gate based only on a transaction expiration date. That can conflict with grace-period access. Similarly, a UI banner based on stale renewal information should not overrule a newly verified active entitlement.

Refresh through the existing transaction/status workflow when relevant evidence changes. Repeatedly forcing App Store synchronization is not a billing-status polling strategy. Apple’s AppStore.sync guidance reserves that authentication-prompting action for explicit user requests such as Restore Purchases.

Test the transitions customers actually see

Use StoreKit’s failing-renewal environment to cover successful renewal, grace entry, grace recovery, grace expiration into retry, and eventual recovery from retry. Confirm both the feature gate and the explanatory message at each step.

The companion’s pure tests cover grace, retry, revocation, mixed active/expired status, and verification uncertainty. They also confirm that unrelated uncertain evidence does not erase a verified active grant for this same-feature policy.

Keep support copy specific. “Your payment needs attention; access continues during the grace period” and “Your subscription is no longer active” describe different experiences and should not be selected by the same Boolean.

September 2026 review: the classifier ran successfully and the signed-status adapter type-checked for iOS 17. Actual renewal simulation, Family Sharing, and tier selection were not exercised by the pure fixture.