last update
May 23, 2026
license
MITv1.0.0
format
SKILL.md
- Install
// Downloads SKILL.md into ~/.claude/skills/ios-storekit2-pro/
$ curl -fsSL --create-dirs -o ~/.claude/skills/ios-storekit2-pro/SKILL.md https://claudeskil.com/skills/ios-storekit2-pro/SKILL.md - Invoke
// Inside Claude Code, type the skill name as a slash command
> /ios-storekit2-pro help me ship this - Or copy this from the README
// extracted from a Usage / Example section
$ > scaffold storekit2 with subscriptions group "pro" and a consumable "coins_100"
- name:
- StoreKit 2 IAP & Subscriptions
- slug:
- ios-storekit2-pro
- version:
- v1.0.0
- license:
- MIT
- author:
- @chiragthummar16
- categories:
- tags:
- #storekit2#iap#subscriptions#ios#monetization
- description:
In-app purchases, subscriptions, server-side receipt validation, restore flow — StoreKit 2 done correctly.
// What you can do with it
- Product.products(for:) to load products from your IDs, and product.purchase() returning a Product.PurchaseResult.
- VerificationResult handling — it always checks .verified vs .unverified rather than trusting the payload, then calls transaction.finish().
- A long-lived listener on Transaction.updates started at launch (in a Task that lives beyond the view) so you catch Ask-to-Buy approvals, renewals, and refunds.
- Entitlement resolution via Transaction.currentEntitlements and Product.SubscriptionInfo.Status for grace-period and billing-retry states.
- AppStore.sync() wired to the restore button (the call Apple expects, not a re-purchase).
- A server stub that verifies signedTransactionInfo JWS and parses App Store Server Notifications V2 (DIDRENEW, EXPIRED, REFUND, GRACEPERIOD_EXPIRED).
README.md
StoreKit 2 IAP & Subscriptions
A scaffolding skill for shipping in-app purchases and auto-renewable subscriptions with Apple's modern, async/await StoreKit 2 framework. It generates the parts developers most often get wrong: the detached transaction listener, Transaction.currentEntitlements checks, the restore flow, and the App Store Server Notifications V2 endpoint that keeps your backend in sync. Built for iOS engineers adding monetization who want a structure that survives App Review.
When to use it
- You're adding a paid tier, consumable credits, or a subscription and starting from a blank
StoreKitimport. - You're migrating off the legacy
SKPaymentQueue/SKProductAPIs and want theProduct/Transactionequivalents. - App Review rejected you for a missing or broken "Restore Purchases" button.
- You need server-side validation but don't want to hand-roll JWS verification of signed transactions.
What it does
The skill scaffolds a typed product catalog and a purchase manager built on real StoreKit 2 APIs:
Product.products(for:)to load products from your IDs, andproduct.purchase()returning aProduct.PurchaseResult.VerificationResult<Transaction>handling — it always checks.verifiedvs.unverifiedrather than trusting the payload, then callstransaction.finish().- A long-lived listener on
Transaction.updatesstarted at launch (in aTaskthat lives beyond the view) so you catch Ask-to-Buy approvals, renewals, and refunds. - Entitlement resolution via
Transaction.currentEntitlementsandProduct.SubscriptionInfo.Statusfor grace-period and billing-retry states. AppStore.sync()wired to the restore button (the call Apple expects, not a re-purchase).- A server stub that verifies
signedTransactionInfoJWS and parses App Store Server Notifications V2 (DID_RENEW,EXPIRED,REFUND,GRACE_PERIOD_EXPIRED).
Usage
curl -fsSL --create-dirs -o ~/.claude/skills/ios-storekit2-pro/SKILL.md https://claudeskil.com/skills/ios-storekit2-pro/SKILL.md
> scaffold storekit2 with subscriptions group "pro" and a consumable "coins_100"
It emits StoreManager.swift, a Products.storekit config file for Xcode testing, and an optional notifications/ server handler.
for await result in Transaction.updates {
guard case .verified(let txn) = result else { continue }
await grantEntitlement(for: txn.productID)
await txn.finish()
}
Tips & gotchas
- Start
Transaction.updatesbefore the first UI appears, otherwise you silently drop transactions completed while the app was backgrounded. - Always call
finish()only after you've delivered the content; an unfinished transaction will be re-delivered on next launch. - Test renewals fast with a
.storekitfile in Xcode — sandbox renews in compressed time, but only StoreKit testing gives you instant refund/revoke simulation. - Never gate features on
purchase()'s return alone; treatcurrentEntitlementsas the source of truth.
FAQ
Do I still need server-side receipt validation? Not the old receipt blob. StoreKit 2 transactions are signed JWS you can verify with Apple's public keys; the skill's server handler does exactly this plus consumes Server Notifications V2.
Minimum iOS version? StoreKit 2 requires iOS 15+. The scaffold targets 15 and uses Product.SubscriptionInfo.Status introduced there.
Does it handle Ask to Buy and family sharing? Yes — both surface through Transaction.updates, which the generated listener handles uniformly.
$ cat reviews/