Use this page with AI
Copy this into your coding assistant and add your request.
Read https://openiap.dev/docs/types/ios/subscription-status-ios and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.
My request: [describe what customers should be able to do]SubscriptionStatusIOS
SubscriptionStatusIOS#
Subscription status from StoreKit 2. Use subscriptionStatusIOS(sku) to get detailed subscription state.
iOS only. A trimmed projection of Apple's Product.SubscriptionInfo.Status — the OpenIAP wrapper exposes renewalInfo and state only; transaction from the Apple type is not surfaced (Apple docs).
Native reference: Apple · Product.SubscriptionInfo.RenewalState
| Name | Summary |
|---|---|
state | Current renewal state (see values below) |
renewalInfo | Verified RenewalInfoIOS for this product, including jsonRepresentation; null when StoreKit cannot verify it |
Subscription State Values#
The state field indicates the current subscription status:
| State | Description | User Access |
|---|---|---|
subscribed | Active subscription | Grant access |
expired | Subscription has expired | Deny access |
revoked | Refunded by Apple | Deny access |
inGracePeriod | Billing failed but grace period active | Grant access (temporary) |
inBillingRetryPeriod | Billing retry in progress | Consider granting access |
unknown | A state this SDK version does not recognize | Check entitlement on your server |
iOS Expiration Reasons#
After a subscription expires, expirationReason in renewalInfo holds StoreKit's raw reason value as a string. Keep values you do not recognize.
| Value | Reason |
|---|---|
"1" | The user turned off auto-renew |
"2" | Billing error (card declined, etc.) |
"3" | The user did not agree to a price increase |
"4" | The product was no longer available |
"5" | Unknown reason |