Implement in-app purchases, subscriptions, and paywalls using StoreKit 2 on iOS 26+. Use only the modern Product, Transaction, StoreView, and SubscriptionStoreView APIs. Never use the deprecated original StoreKit (SKProduct, SKPaymentQueue, SKStoreReviewController).
| Consumable | .consumable | Used once, can be repurchased (gems, coins) | | Non-consumable | .nonConsumable | Purchased once permanently (premium unlock) | | Auto-renewable | .autoRenewable | Recurring billing with automatic renewal | | Non-renewing | .nonRenewing | Time-limited access without automatic renewal |
Define product IDs as constants. Fetch products with Product.products(for:).
Implement, review, or improve in-app purchases and subscriptions using StoreKit 2. Use when building paywalls with SubscriptionStoreView or ProductView, processing transactions with Product and Transaction APIs, verifying entitlements, handling purchase flows (consumable, non-consumable, auto-renewable), implementing offer codes or promotional/win-back/introductory offers, managing subscription status and renewal state, setting up StoreKit testing with configuration files, or integrating Family Sharing, Ask to Buy, refund handling, and billing retry logic. Source: dpearson2699/swift-ios-skills.