This repository was archived by the owner on Oct 16, 2025. It is now read-only.
Merged
Conversation
0cc1a55 to
779631a
Compare
Align code with package platform baselines (iOS 15+, macOS 14+).\n\n- Remove redundant runtime availability checks and legacy fallbacks\n- Replace with direct access\n- Always use ; drop URL fallback\n- Call on main actor\n- Simplify to return current or error\n- Simplify using compiler check; map verified/unverified\n\nMotivation: reduce dead code paths, avoid misleading behavior, and lower maintenance/testing burden.\nImpact: no public API changes; behavior consistent with supported platforms.\nNotes: Requires iOS 15+/tvOS 15+/macOS 14+ as declared in .
- Concurrency/events: - Introduce IapState actor for module state; convert ProductManager to actor - Make emit methods fire-and-forget; mark listeners @sendable - Restrict UIKit access to MainActor; set isInitialized before starting listeners; ignore Transaction.updates before init - Public models: - Standardize on OpenIap* types and filenames (Product, Purchase, ActiveSubscription, ProductRequest, RequestPurchaseProps, ReceiptValidation, Receipt, AppTransaction) - Add typealiases to preserve source compatibility - getAvailablePurchases props: - Rename OpenIapPurchaseOptions → OpenIapGetAvailablePurchasesProps (alias retained) - Store/UI: - Move IapStatus and related types under OpenIapStore as nested types - Add temporary typealias shim for CocoaPods path stability - Remove restorePurchases(); add refreshPurchases(forceSync:) - Error codes: - Centralize OpenIAP string codes in OpenIapError (constants + errorCodes()) - Reintroduce PurchaseError.emptySkuList(); remove redundant PurchaseError.toDictionary() - Serialization: - Add OpenIapSerialization (product, purchase, list helpers, errorCodes) - Pure/non‑MainActor serialization for bridges/analytics - Docs: - Update CONTRIBUTING.md with “public models use OpenIap prefix” BREAKING CHANGE: - OpenIapStore.restorePurchases() removed; use refreshPurchases(forceSync: true) Migration: - Run pod install after file renames (Pods caches file paths) - Prefer OpenIap* type names going forward; old names remain via typealias - Replace manual serialization with OpenIapSerialization helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This series of commits refactors the OpenIAP module by introducing structured concurrency and standardizing public models.
IapStateandProductManagerare nowactors, with events and listeners marked@sendableand UIKit access restricted toMainActor. Public APIs adopt consistentOpenIap*naming, with typealiases provided for backward compatibility, while serialization is consolidated underOpenIapSerializationfor safer bridging and analytics. TherestorePurchases()method has been removed in favor ofrefreshPurchases(forceSync:), and error handling is centralized inOpenIapError. Supporting types likeIapStatusare nested underOpenIapStorefor a cleaner structure. These changes remove outdated availability checks and legacy fallbacks, aligning the codebase with the declared baselines (iOS 15+/tvOS 15+/macOS 14+), reducing maintenance overhead, and ensuring more predictable behavior without altering most external APIs.