◉CLAUDE LABJP
●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 44 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 44 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…
Articles/Claude Code
⟐ Claude Code/2026-04-15Advanced

Building StoreKit 2 × SwiftUI Purchases with Claude Code — The Minimum That Passes Review

Build a StoreKit 2 × SwiftUI purchase flow end to end with Claude Code as your design partner — PurchaseManager, server-side validation, and paywall UI — plus the operational traps Apple's docs skip, like Ask to Buy and late-arriving transactions.

Claude Code264SwiftUI7StoreKit 2iOS26in-app purchasesubscription5Swift5App Store9

✦ Premium Article

Why StoreKit 2 Trips Up Even Experienced Developers

The frustration with StoreKit 2 implementation isn't usually the API itself — it's not knowing what "correct" looks like. Stack Overflow answers reference the old StoreKit 1 APIs. Apple's documentation prioritizes conceptual explanations over showing you the complete picture. And the Sandbox environment's quirks produce bugs that don't appear until production.

StoreKit 2, released in 2022, is a full rewrite around async/await. The shift away from SKPaymentQueue, SKProductsRequest, and completion-handler-based code is welcome — but developers who learned StoreKit 1 often hit unexpected roadblocks when the new Transaction and Product types behave differently from what they expect.

This guide builds a complete StoreKit 2 × SwiftUI implementation from scratch, using Claude Code as a design partner throughout. We'll cover consumable products, auto-renewable subscriptions, server-side validation, and paywall UI — all to the standard required for App Store approval.

For setting up Claude Code with your iOS project, see Claude Code × Swift/iOS Production App Development Guide first.


Why Claude Code Is an Effective StoreKit 2 Partner

Claude Code brings three specific advantages to StoreKit 2 work:

Full project context for architecture decisions. Claude Code reads your entire project before making suggestions. When you say "I want to manage subscription state in this ViewModel," it proposes solutions that fit your existing architecture rather than generic sample code.

Comprehensive error handling in one pass. StoreKit 2 error types span StoreKitError, Product.PurchaseError, and VerificationResult.VerificationError. Asking Claude Code to "handle all StoreKit 2 error cases" produces exhaustive coverage that would take significant research time to assemble manually.

Sandbox debugging support. When Transaction.currentEntitlements returns empty after a successful Sandbox purchase, or when entitlements don't refresh after subscription renewal, Claude Code can diagnose the issue and provide corrected code immediately.


✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Subtle Transaction.updates timing gaps that Apple docs never mention, and a cache-first design that eliminates the flash-of-paywall problem
✦A measured comparison showing a decode-only JWS parser accepting both a tampered payload and an alg:none token, plus why NODE_ENV must not decide the API environment
✦Why treating an Ask to Buy pending state as a failure gets flagged in review, and how to reproduce it in Sandbox
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⟐ Claude Code2026-10-12
After Moving to SPM, My App Died the Moment It Launched — Reading One dyld Line with Claude Code
Right after moving from CocoaPods to Swift Package Manager, the build passed but the app died on launch. Here is how I traced one dyld line to its cause, the fix, and how to verify it.
⟐ Claude Code2026-09-04
The One File I Keep Out of Claude Code's Reach: project.pbxproj
With Xcode project files, the breakage that still opens costs far more than the breakage that refuses to open. Here is what I measured before moving every edit behind a script, and where the line sits today.
⟐ Claude Code2026-10-15
The Hook That Was Meant to Guard My Japanese Folder Never Blocked Anything — Python Was Reading stdin as cp932
A PreToolUse hook guarding folders like 経理 or 議事録 silently lets edits through when Python's stdin defaults to cp932. How I reproduced it, the three-line fix, and one command to check your own hooks.