Skip to content

feat(v2): IAP impl with StoreKit 2 — Phase v2.1 - #59

Merged
wei18 merged 1 commit into
mainfrom
feat/v2.1-iap-storekit2
May 21, 2026
Merged

wei18 merged 1 commit into
mainfrom
feat/v2.1-iap-storekit2

Conversation

@wei18

@wei18 wei18 commented May 21, 2026

Copy link
Copy Markdown
Owner

Phase v2.1 of docs/v2/plan.md — 2 steps.

LiveStoreKit2IAPClient + StoreKitBridge protocol seam + purchase/restore/observer. 22 new tests (57 total). v2.0 inherited §未決 #2 (recordRefund) resolved at v2.1's scope (.revoked event emits correctly; AdGate wiring still v2.3).

Isolation: import StoreKit only in LiveStoreKitBridge.swift. Build clean, 57/57 tests, TODO sweep 0 hits.

🤖 Claude Code

Phase v2.1 complete. LiveStoreKit2IAPClient + StoreKitBridge seam +
Purchase flow + Restore + Transaction observer. 22 new tests, 57 total.

- LiveStoreKit2IAPClient (113 lines, public actor): availableProducts,
  purchase, restorePurchases, purchaseUpdates AsyncStream
- StoreKitBridge protocol seam (lifted from v2.1.2 → v2.1.1 because
  StoreKit.Product has no public init; testing requires the bridge)
- LiveStoreKitBridge adapter — only file importing StoreKit
- IAPProductMapper pure function (independently testable)
- IAPProductIDs.removeAds = com.wei18.sudoku.iap.remove_ads
- FakeStoreKitBridge with scripting + counters

v2.0 inherited §未決 #2 (recordRefund()) RESOLVED at v2.1's scope:
purchaseUpdates() correctly emits .revoked from Transaction.updates
events with non-nil revocationDate. AdGate wiring still deferred to
v2.3 as planned.

New §未決 (non-blocking):
- Empty products(for:) behavior on ASC catalog drift (returns [], not throws)
- @unknown default on Product.PurchaseResult (silent SDK forward-compat)
- Task.detached priority .background on observer (may want .utility v2.3)

Isolation audit: import StoreKit only in LiveStoreKitBridge.swift
(1 hit, internal import). MonetizationCore StoreKit-free. Package.swift
not modified.

Build clean, 57/57 tests in 10 suites, TODO sweep 0 hits.

impl-notes: meetings/2026-05-21_v2.1-iap-storekit2.impl-notes.md
@wei18
wei18 merged commit 1025553 into main May 21, 2026
@wei18
wei18 deleted the feat/v2.1-iap-storekit2 branch May 21, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant