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:).
StoreKit 2를 사용하여 인앱 구매 및 구독을 구현, 검토 또는 개선합니다. SubscriptionStoreView 또는 ProductView로 페이월 구축, 제품 및 트랜잭션 API를 통한 트랜잭션 처리, 권한 확인, 구매 흐름 처리(소모성, 비소모성, 자동 갱신 가능), 제안 코드 또는 판촉/환불/소개 제안 구현, 구독 상태 및 갱신 상태 관리, 구성 파일로 StoreKit 테스트 설정 또는 가족 공유, 구매 요청, 환불 통합 시 사용합니다. 처리 및 청구 재시도 논리. 출처: dpearson2699/swift-ios-skills.