apple-storekit

Implement in-app purchases, subscriptions, and entitlements on Apple platforms with StoreKit 2.

Updated Jun 17, 2026
One-click install
npx skills add https://github.com/Yar177/appleNativeSkills --skill apple-storekit-yar177
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: apple-storekit
Source: https://github.com/Yar177/appleNativeSkills/tree/main/apple-storekit
Command: npx skills add https://github.com/Yar177/appleNativeSkills --skill apple-storekit-yar177

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building in-app purchases and subscriptions on Apple platforms involves many failure-prone details: missed transaction updates, unverified transactions, wrong entitlement state after reinstalls, and App Review rejections. This Skill provides a complete, correct StoreKit 2 implementation guide covering the full purchase lifecycle. ## Core Features & Use Cases - Purchase Flow & Verification: Load products, handle all four PurchaseResult cases, verify signed JWS transactions via VerificationResult, and finish transactions correctly. - Entitlements & Subscriptions: Recompute ownership from Transaction.currentEntitlements, handle subscription status, grace periods, billing retry, and intro/promotional/win-back offers. - Server Validation & Testing: Validate transactions server-side with the App Store Server API and Server Notifications V2, and test with .storekit config files, StoreKitTest, and sandbox. - Use Case: You are adding a yearly Pro subscription to your iOS app. Use this Skill to build the paywall with SubscriptionStoreView, start the transaction listener at launch, gate features on currentEntitlements, and test renewals with SKTestSession before release. ## Quick Start Use the apple-storekit skill to implement a StoreKit 2 subscription paywall with purchase verification, entitlement gating, and a restore purchases button.

Frequently Asked Questions about apple-storekit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement in-app purchases with StoreKit 2 in Swift?

Load products with Product.products(for:), call product.purchase(), and handle all four PurchaseResult cases. Verify every transaction through VerificationResult, grant entitlement from Transaction.currentEntitlements, and call finish() on verified transactions.

How do I check subscription status and grace period in StoreKit 2?

Use product.subscription.status to get Product.SubscriptionInfo.Status values, then switch on state: .subscribed, .inGracePeriod, .inBillingRetryPeriod, .expired, or .revoked. Grant access during grace period and check renewal state rather than expirationDate alone.

Should I use StoreKit 2 or the legacy SKPaymentQueue API?

Use StoreKit 2 (Product, Transaction, async/await) for all new code; it provides signed, pre-verified JWS transactions and simple entitlement queries. Only use SKPaymentQueue when supporting iOS 14 or earlier, and never mix both systems for the same product.

Why are my StoreKit purchases not restoring on a new device?

Restoration fails when entitlements are cached locally instead of recomputed from Transaction.currentEntitlements, or when the Transaction.updates listener starts too late. Provide an explicit Restore Purchases button calling AppStore.sync(), which App Review requires.

How do I test StoreKit purchases without App Store Connect?

Create a .storekit configuration file in Xcode and select it in the scheme's Run options to test purchases locally with no network. For automated tests, use StoreKitTest's SKTestSession to drive purchases, renewals, refunds, and time-accelerated subscriptions.

How do I validate App Store transactions on my server?

Use the App Store Server API with an ES256 JWT signed by your In-App Purchase key, and receive App Store Server Notifications V2 at your endpoint. Verify signed JWS payloads against the Apple Root CA - G3 chain using Apple's app-store-server-library.