iOS subscriptionStatusIOS
Get detailed subscription status using StoreKit 2 (iOS 15+, macOS 14+).
Wraps Product.SubscriptionInfo.status — returns an array projected onto SubscriptionStatusIOS, which exposes only renewalInfo and state. The transaction field on Apple's Status type is not surfaced by this wrapper; if you need the underlying transaction, call latestTransactionIOS(sku) separately. iOS 15+, macOS 14+. See the Apple StoreKit reference.
Signature
swift
func subscriptionStatusIOS(sku: String) async throws -> [SubscriptionStatusIOS]Parameters#
sku(required,string) — Subscription product identifier.
Returns#
Promise<SubscriptionStatusIOS[]> — one entry per status the user has on the subscription:
state(string) — StoreKit 2 renewal state (e.g."subscribed","inGracePeriod","expired").renewalInfo(RenewalInfoIOS?) — Renewal metadata (auto-renew flag, renewal date, expiration reason). May benull.
Example
swift
let status = try await OpenIapModule.shared.subscriptionStatusIOS(sku: "com.app.monthly")