feat: deprecate platform field and ios/android props#49
Conversation
- Add IapStore enum (Unknown, Apple, Google, Horizon) - Add store field to PurchaseCommon interface - Deprecate platform field in favor of store - Deprecate ios/android props in requestPurchase/requestSubscription - Add apple/google props as replacements - Update all example codes and documentation - Add v1.3.0 release notes with migration guide
|
Warning Rate limit exceeded@hyochan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 17 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughThis pull request introduces Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25–35 minutes
Possibly related issues
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/docs/src/pages/docs/types.tsx (1)
2719-2772: Update RequestVerifyPurchaseWithIapkitResult.store type from IapkitStore to IapStoreThe generated types in
packages/gql/src/generated/types.tsdefineRequestVerifyPurchaseWithIapkitResult.storeasIapStore(which includes'unknown' | 'apple' | 'google' | 'horizon'), but the documentation referencesIapkitStorewith only'apple' | 'google'. Update lines 2747 and the entireIapkitStoreenum section (lines 2847-2872) to useIapStoreinstead to match the actual generated types.
🧹 Nitpick comments (5)
packages/google/openiap/src/play/java/dev/hyo/openiap/utils/BillingConverters.kt (1)
136-145: Consider usingtransactionIdforActiveSubscription.transactionIdfor clarity.Now that
PurchaseAndroidhas an explicittransactionIdfield,toActiveSubscription()still mapstransactionId = id. Ifidcan ever diverge from the gateway transaction identifier (e.g., fallback topurchaseToken), consider switching this to use the newtransactionIdproperty instead so the semantics are explicit and consistent.Based on learnings, keeping these mappings aligned with the schema/docs will reduce confusion later.
packages/docs/src/pages/docs/features/subscription.tsx (1)
356-367: Docs examples now match apple/google request payloadsThe updated
requestPurchaseexamples usingappleandrequestlook consistent with the new per‑store props and store discriminator. As a follow‑up, ensure any other docs still showingios/androidpayload keys (e.g. type tables or older examples) are updated or explicitly marked deprecated so readers don’t mix the two shapes.Also applies to: 492-493, 761-766, 897-905
packages/gql/src/type-ios.graphql (1)
124-168: GraphQL:storefield addition andplatformdeprecation look correctAdding
store: IapStore!onPurchaseIOSand deprecatingplatformmatches the new store‑centric model while preserving backwards compatibility. Sincestoreis non‑null, please ensure all resolvers always populate it (including legacy data paths), and rerun the GraphQL codegen so Swift/TS/Kotlin/Dart types stay in sync, as per thepackages/gqlguidelines.packages/docs/src/pages/docs/types.tsx (1)
199-205: Align discriminator docs fully with the newstorefieldThe additions of
storeto Product/Purchase common fields and the new “Store Discriminators” section clearly communicate the newapple/horizon/unknownenum and the deprecation ofplatform. That said, a few narrative bits still talk aboutplatformas the primary discriminator:
- Line 199–205: Product is described as “discriminated by the
platformfield”.- Line 681–689: Purchase likewise says it’s discriminated by
platform.- Line 638–640: “Use the
platformfield to narrow the type…”To avoid confusion, consider updating those sentences to say “discriminated by the
storefield” and recommend usingstorefor narrowing, withplatformcalled out only as a deprecated, backwards‑compat alias.Also applies to: 272-289, 539-641, 681-689, 742-809
packages/docs/src/pages/docs/updates/notes.tsx (1)
79-81: Clarify all possiblestorevalues for completeness.The comment shows
purchase.store // 'apple' | 'google'but theIapStoreenum includes four values:'unknown','apple','google', and'horizon'. Consider documenting all possible values or adding a note that'apple'and'google'are the common values users will encounter in typical usage.// Purchase store field -purchase.store // 'apple' | 'google' +purchase.store // 'apple' | 'google' | 'horizon' | 'unknown' purchase.platform // deprecated
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
packages/gql/src/generated/Types.ktis excluded by!**/generated/**packages/gql/src/generated/Types.swiftis excluded by!**/generated/**packages/gql/src/generated/types.dartis excluded by!**/generated/**packages/gql/src/generated/types.tsis excluded by!**/generated/**
📒 Files selected for processing (20)
packages/apple/Sources/Helpers/StoreKitTypesBridge.swift(1 hunks)packages/apple/Sources/Models/Types.swift(10 hunks)packages/apple/Sources/OpenIapModule+ObjC.swift(1 hunks)packages/apple/Sources/OpenIapModule.swift(4 hunks)packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swift(1 hunks)packages/docs/src/pages/docs/apis.tsx(5 hunks)packages/docs/src/pages/docs/features/external-purchase.tsx(2 hunks)packages/docs/src/pages/docs/features/purchase.tsx(1 hunks)packages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsx(3 hunks)packages/docs/src/pages/docs/features/subscription.tsx(5 hunks)packages/docs/src/pages/docs/types.tsx(10 hunks)packages/docs/src/pages/docs/updates/notes.tsx(1 hunks)packages/google/openiap/src/horizon/java/dev/hyo/openiap/utils/BillingConverters.kt(2 hunks)packages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt(13 hunks)packages/google/openiap/src/main/java/dev/hyo/openiap/utils/PurchaseVerificationValidator.kt(4 hunks)packages/google/openiap/src/play/java/dev/hyo/openiap/utils/BillingConverters.kt(2 hunks)packages/gql/scripts/generate-kotlin-types.mjs(1 hunks)packages/gql/src/type-android.graphql(1 hunks)packages/gql/src/type-ios.graphql(1 hunks)packages/gql/src/type.graphql(5 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: iOS-specific functions must end withIOSsuffix (e.g.,clearTransactionIOS,getAppTransactionIOS)
Android-specific functions must end withAndroidsuffix (e.g.,acknowledgePurchaseAndroid,consumePurchaseAndroid)
Use action prefixes for function naming:getfor retrieval,requestfor async operations,clearfor removal,is/hasfor boolean checks,show/presentfor UI display,begin/finish/endfor process controlPrefer interface for defining object shapes in TypeScript
Files:
packages/docs/src/pages/docs/features/purchase.tsxpackages/docs/src/pages/docs/updates/notes.tsxpackages/docs/src/pages/docs/apis.tsxpackages/docs/src/pages/docs/features/subscription.tsxpackages/docs/src/pages/docs/features/external-purchase.tsxpackages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsxpackages/docs/src/pages/docs/types.tsx
packages/docs/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
packages/docs/**/*.{ts,tsx}: Use kebab-case for search modal IDs (e.g.,id: 'request-products')
Modal state should be defined once at the app root level using Preact Signals (signal from '@preact/signals-react'), not instantiated multiple times
ALL components must fit within parent boundaries and never overflow outside parent containers; useoverflow-hidden,break-words, andwhitespace-nowrapas needed
Delete unused components, functions, and imports immediately; do not keep commented-out code or unused variables
ANY function that returns a Promise must be wrapped withvoidoperator when used where a void return is expected (e.g., event handlers)
Files:
packages/docs/src/pages/docs/features/purchase.tsxpackages/docs/src/pages/docs/updates/notes.tsxpackages/docs/src/pages/docs/apis.tsxpackages/docs/src/pages/docs/features/subscription.tsxpackages/docs/src/pages/docs/features/external-purchase.tsxpackages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsxpackages/docs/src/pages/docs/types.tsx
packages/docs/**/*
📄 CodeRabbit inference engine (CLAUDE.md)
packages/docs/**/*: Before committing, runnpx prettier --write,npm run lint,bun run tscornpm run typecheck, andnpm run buildto verify formatting, linting, types, and build success
Use conventional commit format with lowercase type prefix and lowercase description (e.g.,feat: add user authentication)
Files:
packages/docs/src/pages/docs/features/purchase.tsxpackages/docs/src/pages/docs/updates/notes.tsxpackages/docs/src/pages/docs/apis.tsxpackages/docs/src/pages/docs/features/subscription.tsxpackages/docs/src/pages/docs/features/external-purchase.tsxpackages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsxpackages/docs/src/pages/docs/types.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (GEMINI.md)
**/*.{ts,tsx,js,jsx}: Use camelCase for variable and function names
Use PascalCase for class and component names
Always use async/await for handling promises instead of .then() chains
Add JSDoc comments for public functions and exported APIs
Use const by default, let if reassignment is needed, avoid var
Files:
packages/docs/src/pages/docs/features/purchase.tsxpackages/docs/src/pages/docs/updates/notes.tsxpackages/docs/src/pages/docs/apis.tsxpackages/docs/src/pages/docs/features/subscription.tsxpackages/docs/src/pages/docs/features/external-purchase.tsxpackages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsxpackages/docs/src/pages/docs/types.tsx
packages/apple/**/*.swift
📄 CodeRabbit inference engine (CLAUDE.md)
packages/apple/**/*.swift: iOS-specific functions MUST haveIOSsuffix (e.g.,presentCodeRedemptionSheetIOS(),showManageSubscriptionsIOS())
Use Pascal case for acronyms at the beginning or middle of names (e.g.,IapManager,IapPurchase), but ALL CAPS only when appearing as a suffix (e.g.,ProductIAP,OpenIAP)
Files:
packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swiftpackages/apple/Sources/Helpers/StoreKitTypesBridge.swiftpackages/apple/Sources/OpenIapModule.swiftpackages/apple/Sources/Models/Types.swiftpackages/apple/Sources/OpenIapModule+ObjC.swift
packages/apple/Sources/Helpers/**/*.swift
📄 CodeRabbit inference engine (CLAUDE.md)
Place internal helper classes in
Sources/Helpers/(e.g.,ProductManager.swiftfor thread-safe caching,IapStatus.swiftfor UI status); these are NOT official OpenIAP types
Files:
packages/apple/Sources/Helpers/StoreKitTypesBridge.swift
packages/google/**/*.kt
📄 CodeRabbit inference engine (CLAUDE.md)
DO NOT add
Androidsuffix to function names in the Android-only package, even for Android-specific APIs (e.g., useacknowledgePurchase()notacknowledgePurchaseAndroid())
Files:
packages/google/openiap/src/play/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/utils/PurchaseVerificationValidator.ktpackages/google/openiap/src/horizon/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt
packages/google/openiap/src/main/java/dev/hyo/openiap/utils/**/*.kt
📄 CodeRabbit inference engine (CLAUDE.md)
Place reusable Kotlin helper functions in
openiap/src/main/java/dev/hyo/openiap/utils/
Files:
packages/google/openiap/src/main/java/dev/hyo/openiap/utils/PurchaseVerificationValidator.kt
packages/gql/**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Run
bun run generateto regenerate types for all platforms (TypeScript, Swift, Kotlin, Dart) from the GraphQL schema
Files:
packages/gql/src/type-android.graphqlpackages/gql/scripts/generate-kotlin-types.mjspackages/gql/src/type-ios.graphqlpackages/gql/src/type.graphql
packages/apple/Sources/Models/Types.swift
📄 CodeRabbit inference engine (CLAUDE.md)
DO NOT edit
Types.swiftinSources/Models/as it is auto-generated from the OpenIAP GraphQL schema; regenerate using./scripts/generate-types.sh
Files:
packages/apple/Sources/Models/Types.swift
packages/apple/Sources/Models/**/*.swift
📄 CodeRabbit inference engine (CLAUDE.md)
OpenIAP official types in
Sources/Models/must match types defined at openiap.dev/docs/types
Files:
packages/apple/Sources/Models/Types.swift
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/openiap-versions.json : To update OpenIAP GraphQL types in the iOS/macOS library, edit the `gql` field in `openiap-versions.json`, run `./scripts/generate-types.sh`, and run `swift test` to verify compatibility
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/Sources/Models/**/*.swift : OpenIAP official types in `Sources/Models/` must match types defined at [openiap.dev/docs/types](https://www.openiap.dev/docs/types)
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/Sources/Models/Types.swift : DO NOT edit `Types.swift` in `Sources/Models/` as it is auto-generated from the OpenIAP GraphQL schema; regenerate using `./scripts/generate-types.sh`
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/**/*.swift : Use Pascal case for acronyms at the beginning or middle of names (e.g., `IapManager`, `IapPurchase`), but ALL CAPS only when appearing as a suffix (e.g., `ProductIAP`, `OpenIAP`)
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to **/*.{ts,tsx} : Android-specific functions must end with `Android` suffix (e.g., `acknowledgePurchaseAndroid`, `consumePurchaseAndroid`)
Applied to files:
packages/docs/src/pages/docs/features/purchase.tsxpackages/docs/src/pages/docs/apis.tsxpackages/docs/src/pages/docs/features/subscription.tsxpackages/docs/src/pages/docs/features/external-purchase.tsxpackages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsxpackages/docs/src/pages/docs/types.tsxpackages/gql/src/type-android.graphql
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/openiap-versions.json : To update OpenIAP GraphQL types in the iOS/macOS library, edit the `gql` field in `openiap-versions.json`, run `./scripts/generate-types.sh`, and run `swift test` to verify compatibility
Applied to files:
packages/docs/src/pages/docs/features/purchase.tsxpackages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swiftpackages/docs/src/pages/docs/updates/notes.tsxpackages/docs/src/pages/docs/apis.tsxpackages/apple/Sources/Helpers/StoreKitTypesBridge.swiftpackages/gql/src/type-android.graphqlpackages/gql/src/type-ios.graphqlpackages/gql/src/type.graphqlpackages/apple/Sources/OpenIapModule.swiftpackages/apple/Sources/Models/Types.swiftpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.ktpackages/apple/Sources/OpenIapModule+ObjC.swift
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/google/**/*.kt : DO NOT add `Android` suffix to function names in the Android-only package, even for Android-specific APIs (e.g., use `acknowledgePurchase()` not `acknowledgePurchaseAndroid()`)
Applied to files:
packages/docs/src/pages/docs/features/purchase.tsxpackages/docs/src/pages/docs/features/external-purchase.tsxpackages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsxpackages/google/openiap/src/play/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/utils/PurchaseVerificationValidator.ktpackages/gql/src/type-android.graphqlpackages/google/openiap/src/horizon/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/docs/**/*.{ts,tsx} : Use kebab-case for search modal IDs (e.g., `id: 'request-products'`)
Applied to files:
packages/docs/src/pages/docs/features/purchase.tsx
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/google/openiap-versions.json : To update OpenIAP GraphQL types in the Android library, edit the `gql` field in `openiap-versions.json`, then run `./scripts/generate-types.sh` and compile to verify
Applied to files:
packages/docs/src/pages/docs/features/purchase.tsxpackages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsxpackages/google/openiap/src/play/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/utils/PurchaseVerificationValidator.ktpackages/gql/src/type-android.graphqlpackages/gql/scripts/generate-kotlin-types.mjspackages/gql/src/type-ios.graphqlpackages/gql/src/type.graphqlpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to **/*.{ts,tsx} : iOS-specific functions must end with `IOS` suffix (e.g., `clearTransactionIOS`, `getAppTransactionIOS`)
Applied to files:
packages/docs/src/pages/docs/features/purchase.tsx
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/Sources/Models/**/*.swift : OpenIAP official types in `Sources/Models/` must match types defined at [openiap.dev/docs/types](https://www.openiap.dev/docs/types)
Applied to files:
packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swiftpackages/docs/src/pages/docs/apis.tsxpackages/apple/Sources/Helpers/StoreKitTypesBridge.swiftpackages/gql/src/type-ios.graphqlpackages/gql/src/type.graphqlpackages/apple/Sources/OpenIapModule.swiftpackages/apple/Sources/Models/Types.swiftpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.ktpackages/apple/Sources/OpenIapModule+ObjC.swift
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/**/*.swift : Use Pascal case for acronyms at the beginning or middle of names (e.g., `IapManager`, `IapPurchase`), but ALL CAPS only when appearing as a suffix (e.g., `ProductIAP`, `OpenIAP`)
Applied to files:
packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swiftpackages/apple/Sources/Helpers/StoreKitTypesBridge.swiftpackages/gql/src/type.graphqlpackages/apple/Sources/OpenIapModule.swiftpackages/apple/Sources/Models/Types.swift
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/Sources/Models/Types.swift : DO NOT edit `Types.swift` in `Sources/Models/` as it is auto-generated from the OpenIAP GraphQL schema; regenerate using `./scripts/generate-types.sh`
Applied to files:
packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swiftpackages/docs/src/pages/docs/apis.tsxpackages/apple/Sources/Helpers/StoreKitTypesBridge.swiftpackages/docs/src/pages/docs/types.tsxpackages/gql/src/type-ios.graphqlpackages/gql/src/type.graphqlpackages/apple/Sources/OpenIapModule.swiftpackages/apple/Sources/Models/Types.swiftpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.ktpackages/apple/Sources/OpenIapModule+ObjC.swift
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/Sources/Helpers/**/*.swift : Place internal helper classes in `Sources/Helpers/` (e.g., `ProductManager.swift` for thread-safe caching, `IapStatus.swift` for UI status); these are NOT official OpenIAP types
Applied to files:
packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swiftpackages/apple/Sources/Helpers/StoreKitTypesBridge.swiftpackages/apple/Sources/OpenIapModule.swiftpackages/apple/Sources/Models/Types.swiftpackages/apple/Sources/OpenIapModule+ObjC.swift
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/apple/**/*.swift : iOS-specific functions MUST have `IOS` suffix (e.g., `presentCodeRedemptionSheetIOS()`, `showManageSubscriptionsIOS()`)
Applied to files:
packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swift
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/google/openiap/src/main/Types.kt : DO NOT edit `openiap/src/main/Types.kt` as it is auto-generated from the GraphQL schema; regenerate it using `./scripts/generate-types.sh`
Applied to files:
packages/google/openiap/src/play/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/utils/PurchaseVerificationValidator.ktpackages/gql/src/type-android.graphqlpackages/gql/scripts/generate-kotlin-types.mjspackages/google/openiap/src/horizon/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/gql/src/type.graphqlpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/google/openiap/src/main/java/dev/hyo/openiap/utils/**/*.kt : Place reusable Kotlin helper functions in `openiap/src/main/java/dev/hyo/openiap/utils/`
Applied to files:
packages/google/openiap/src/play/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/utils/PurchaseVerificationValidator.ktpackages/google/openiap/src/horizon/java/dev/hyo/openiap/utils/BillingConverters.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt
📚 Learning: 2025-12-06T20:15:59.223Z
Learnt from: CR
Repo: hyodotdev/openiap PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T20:15:59.223Z
Learning: Applies to packages/gql/**/* : Run `bun run generate` to regenerate types for all platforms (TypeScript, Swift, Kotlin, Dart) from the GraphQL schema
Applied to files:
packages/gql/scripts/generate-kotlin-types.mjs
🧬 Code graph analysis (5)
packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swift (1)
packages/gql/src/generated/types.ts (1)
IapStore(183-183)
packages/docs/src/pages/docs/updates/notes.tsx (2)
packages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt (2)
code(1290-1312)code(1845-1864)packages/gql/src/generated/Types.kt (2)
code(1357-1379)code(1912-1931)
packages/gql/scripts/generate-kotlin-types.mjs (2)
packages/gql/scripts/generate-swift-types.mjs (10)
interfaceFields(623-623)fields(272-272)fields(281-281)fields(356-356)fields(388-388)fields(542-542)fields(615-615)fields(652-654)fields(687-689)type(237-237)packages/gql/scripts/generate-dart-types.mjs (10)
interfaceFields(767-767)fields(196-196)fields(296-296)fields(437-437)fields(480-480)fields(626-626)fields(759-759)fields(805-805)fields(813-815)type(152-152)
packages/apple/Sources/OpenIapModule.swift (2)
packages/gql/src/generated/types.ts (2)
IapStore(183-183)RequestVerifyPurchaseWithIapkitResult(798-804)packages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt (19)
rawValue(15-44)rawValue(46-166)rawValue(171-194)rawValue(196-221)rawValue(226-289)rawValue(291-307)rawValue(309-330)rawValue(332-353)rawValue(355-373)rawValue(375-390)rawValue(392-413)rawValue(415-442)rawValue(444-456)rawValue(458-473)rawValue(475-499)isValid(1571-1599)isValid(1806-1843)code(1290-1312)code(1845-1864)
packages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt (1)
packages/gql/src/generated/types.ts (3)
RequestVerifyPurchaseWithIapkitResult(798-804)RequestPurchasePropsByPlatforms(730-739)RequestSubscriptionPropsByPlatforms(768-777)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test Android
🔇 Additional comments (30)
packages/google/openiap/src/horizon/java/dev/hyo/openiap/utils/BillingConverters.kt (1)
7-7: LGTM! Correct store assignment for Horizon purchases.The addition of
IapStore.Horizonis appropriate for Meta Horizon billing purchases and aligns with the PR's migration from platform-based to store-based identification.Also applies to: 122-122
packages/google/openiap/src/play/java/dev/hyo/openiap/utils/BillingConverters.kt (1)
5-5: Correctly wiring Google purchases toIapStore.Google.Importing
IapStore(Line 5) and settingstore = IapStore.GoogleinBillingPurchase.toPurchase()cleanly hooks Google Billing purchases into the new store enum without changing existing behavior of other fields. This is aligned with the PR’s migration away fromplatformwhile retaining backward compatibility.Also applies to: 121-123
packages/gql/scripts/generate-kotlin-types.mjs (2)
488-494: LGTM! Efficient interface field collection.The logic correctly collects all field names from implemented interfaces using a Set for efficient lookup. This handles edge cases properly (empty interfaces, overlapping fields across multiple interfaces).
500-501: Override keyword implementation for interface properties is correct and essential.The code correctly adds the
overridekeyword to data class properties that implement interface properties (lines 500-501, 504, 507-508), which is syntactically required for Kotlin compilation. TheinterfaceFieldsSet (lines 489-493) properly collects field names from all implemented interfaces, and theneedsOverrideflag ensures only matching properties receive the override modifier. This is critical for types implementing interfaces likePurchaseCommonwith the newstorefield.packages/docs/src/pages/docs/features/subscription-upgrade-downgrade.tsx (1)
1111-1116: DartRequestPurchasePropsByPlatformscorrectly exposesThe Dart bindings in
packages/gql/src/generated/types.dartconfirm that the type exposes both the deprecatedandroidfield and the currentgoogle: RequestPurchaseAndroidProps?field. The three Dart code examples in the documentation (lines 1111–1116, 1252–1257, 1540–1544) usinggoogle: RequestPurchaseAndroidProps(...)are correct and will compile as-is.packages/apple/Sources/Helpers/StoreKitTypesBridge.swift (1)
127-173: Settingstore: .appleon iOS purchases is correct and consistently appliedThe
storefield is a required property inPurchaseIOSand has been properly set to.appleacross all implementations: the primaryStoreKitTypesBridgeconverter, all test fixtures (OpenIapTests,RenewalInfoTests), and the Objective-C bridge. The change maintains backwards compatibility with the existingplatform: .iosfield, which is now marked as deprecated in favor of the newstorefield.packages/docs/src/pages/docs/features/external-purchase.tsx (2)
835-836: Documentation correctly updated for newThe TypeScript code example now uses
google: { skus: [productId] }instead of the deprecatedandroidkey, aligning with the API migration from platform-based to store-based naming.
913-916: Kotlin example consistently updated.The Kotlin example uses
google = RequestPurchaseAndroidProps(...), matching the TypeScript changes and maintaining consistency across language examples.packages/apple/Sources/Models/Types.swift (4)
189-195: NewIapStoreenum correctly generated.The enum includes all expected cases (
unknown,apple,horizon), matching the GraphQL schema type definition inpackages/gql/src/generated/types.ts. Based on learnings, this file is auto-generated from the GraphQL schema.
271-279:PurchaseCommonprotocol correctly extended withstoreproperty.The deprecation comment on
platformand the newstore: IapStoreproperty align with the migration strategy. The protocol now requires both for backward compatibility during the transition period.
937-958:RequestPurchasePropsByPlatformscorrectly extended.The struct now includes:
appleandiosandandroidretained with deprecation comments for backward compatibility- Initializer accepts all four parameters
This maintains API compatibility while guiding users toward the new naming convention.
1416-1424: Computedstoreproperty correctly added toPurchaseenum.The implementation properly delegates to the underlying
PurchaseAndroidorPurchaseIOSvariant'sstoreproperty, maintaining consistency with thePurchaseCommonprotocol.packages/apple/Tests/OpenIapTests/VerifyPurchaseWithProviderTests.swift (2)
9-13: Test data correctly uses newIapStoreenum.The
RequestVerifyPurchaseWithIapkitResultis constructed withstore: .apple, which now refers toIapStore.applerather than the previousIapkitStore.apple, aligning with the type migration.
43-43: Assertion correctly updated to useIapStore.apple.The test now asserts against
IapStore.apple, matching the updated type signature ofRequestVerifyPurchaseWithIapkitResult.store.packages/apple/Sources/OpenIapModule+ObjC.swift (1)
273-307: MinimalPurchaseIOScorrectly includes requiredstorefield.The
store: .appleassignment is necessary to satisfy the updatedPurchaseIOSstruct requirements. This is the correct value for iOS transactions created in the Apple package.packages/docs/src/pages/docs/features/purchase.tsx (1)
279-281: TypeScript purchase example correctly updated to new API.The code example now uses
apple: { sku: productId }andgoogle: { skus: [productId] }, reflecting the migration fromios/androidtoapple/packages/google/openiap/src/main/java/dev/hyo/openiap/utils/PurchaseVerificationValidator.kt (2)
95-96: LGTM!The migration from
IapkitStore.GoogletoIapStore.Googleis correct and aligns with the unified store taxonomy introduced in this PR.
169-189: Good addition of Horizon support and error handling.The function correctly:
- Accepts the new
IapStoretype- Handles both
IapStore.GoogleandIapStore.Horizonin the same branch- Uses
store.rawValuewhich matches the Kotlin enum property- Provides clear error handling for unsupported stores
packages/gql/src/type-android.graphql (1)
69-99: LGTM! Clean deprecation path with backward compatibility.The schema update correctly:
- Adds the new
store: IapStore!field with clear documentation- Retains the deprecated
platform: IapPlatform!field for backward compatibility- Uses proper GraphQL
@deprecateddirective syntax- Provides clear migration guidance via the deprecation reason
This approach ensures existing clients continue to work while new clients can adopt the preferred
storefield.packages/apple/Sources/OpenIapModule.swift (2)
656-657: LGTM! Correct migration to IapStore.The change from
IapkitStoretoIapStorealigns with the unified store taxonomy introduced across the codebase.
734-765: Excellent addition of Horizon support and error handling.The function correctly:
- Accepts the new
IapStoretype- Handles
.horizonin the same branch (both use Google-style payload)- Adds explicit error handling for
.unknownstore type- Maintains clean separation between Apple and Google/Horizon verification paths
The defensive programming with the
.unknowncase prevents silent failures if an invalid store type is passed.packages/gql/src/type.graphql (2)
38-43: LGTM! Well-structured enum with clear taxonomy.The new
IapStoreenum properly replacesIapkitStoreand adds support forUnknownandHorizonstores. The enum values use PascalCase which is consistent with GraphQL conventions.
194-230: Excellent backward-compatible migration strategy.The platform-specific request props correctly:
- Introduce new
appleand- Retain deprecated
iosandandroidfields for backward compatibility- Use proper GraphQL
@deprecateddirective syntax- Apply the same pattern consistently across both
RequestPurchasePropsByPlatformsandRequestSubscriptionPropsByPlatformsThis ensures existing clients continue to function while providing a clear migration path to the new naming.
packages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt (7)
309-330: Auto-generatedIapStoreenum looks correct.The new enum with
Unknown,Apple,Horizonvariants follows the established pattern of other enums in this file and aligns with the GraphQL schema changes. Based on learnings, this file is auto-generated—ensure changes originate from the GraphQL schema and./scripts/generate-types.sh.
527-541: Deprecation and newstorefield properly added toPurchaseCommon.The
platformfield is correctly marked as deprecated with guidance to usestoreinstead, and the newstore: IapStorefield is added. This matches the pattern in the relevant GraphQL types.
1221-1284:PurchaseAndroidcorrectly implements the newstorefield.The data class properly adds the
storeproperty with deprecation notice onplatform, and thefromJson/toJsonmethods correctly handle serialization. Implementation is consistent with thePurchaseCommoninterface.
1331-1427:PurchaseIOScorrectly implements the newstorefield.Same pattern as
PurchaseAndroid—thestorefield is added with proper deprecation ofplatform, and JSON serialization is handled correctly.
1580-1597:RequestVerifyPurchaseWithIapkitResultcorrectly addsstorefield.The implementation matches the GraphQL types definition showing
store: IapStorein this result type. Serialization is correctly handled.
2195-2230:RequestPurchasePropsByPlatformscorrectly addsapple/The implementation matches the GraphQL types definition:
androidis deprecated in favor ofiosis deprecated in favor ofapple- Both new and deprecated fields are preserved for backward compatibility
This aligns with the relevant code snippet from
packages/gql/src/generated/types.tslines 729-738.
2315-2350:RequestSubscriptionPropsByPlatformscorrectly addsapple/Same pattern as
RequestPurchasePropsByPlatforms—deprecatedandroid/iosfields with newapple/packages/gql/src/generated/types.tslines 767-776.
hyodotdev/openiap#49 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added store field to purchase details for better tracking * Enhanced error handling with detailed error information in verification results * **Bug Fixes** * Fixed verification result structure for improved data consistency * **Documentation** * Updated comprehensive API documentation and guides with latest examples * Expanded setup guides for iOS, Android, and Horizon platforms * Added detailed error handling, subscription, and purchase flow documentation <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Deprecated
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.