feat(apple): support iOS subscription billing plans - #199
Conversation
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (30)
📝 WalkthroughWalkthroughThis PR adds iOS 26.4 billing-plan support for monthly subscriptions with 12-month commitments. It threads new billing-plan, pricing-term, and commitment fields through shared models, native StoreKit handling, cross-platform SDK bindings, documentation, and tests. ChangesiOS Commitment Billing Plan Support
Estimated code review effort: 4 (Complex) | ~75 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
@coderabbitai review |
|
/gemini review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Code Review
This pull request implements support for iOS subscription commitment billing plans (StoreKit 26.4) across various platform libraries, including Expo, React Native, Flutter, KMP, Godot, and MAUI. It introduces new types, enums, and properties to handle monthly billing with a 12-month commitment and up-front billing. Feedback on the changes highlights a critical issue in the Godot integration where the payload key for the Apple platform is incorrectly set to "ios" instead of "apple", which will cause native decoding to fail. Additionally, several potential runtime type mismatch errors were identified in the GDScript types file where string values could be incorrectly assigned to statically typed integer enums.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@libraries/kmp-iap/library/src/commonTest/kotlin/io/github/hyochan/kmpiap/InAppPurchaseTest.kt`:
- Around line 168-177: The test only verifies direct property assignment in
RequestSubscriptionIosProps, but the changed behavior lives in the Types.kt JSON
serialization path. Update
testRequestSubscriptionIosPropsWithAdvancedCommerceData to round-trip the object
through toJson and fromJson, and assert that billingPlanType is preserved along
with sku and advancedCommerceData so the new wiring is exercised end-to-end.
In
`@libraries/kmp-iap/library/src/iosMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseIOS.kt`:
- Around line 1152-1175: `convertAnyListToSubscriptionPricingTermsIOS` and the
nested helpers `convertAnyToTransactionCommitmentInfoIOS` /
`convertAnyToRenewalInfoIOS` currently swallow decode errors with `getOrNull()`
and `mapNotNull()`, which can produce partial or silently missing metadata.
Update these conversions to fail or return null for the whole field when any
entry/object cannot be decoded, instead of filtering bad items out, so schema
mismatches are surfaced rather than partially rendered.
In `@packages/apple/Sources/OpenIapModule`+ObjC.swift:
- Around line 264-271: Reject unsupported billingPlanType values in
OpenIapModule+ObjC at the ObjC boundary instead of mapping them to
SubscriptionBillingPlanTypeIOS.unknown. Update the billingPlanType conversion in
the request-building path to validate the raw string explicitly, and if it is
not a recognized SubscriptionBillingPlanTypeIOS case, return a developer error
immediately from this initializer/bridge method rather than letting
RequestSubscriptionIosProps or purchaseOptions fail later.
In `@packages/docs/src/pages/docs/types/ios/subscription-billing-plan-ios.tsx`:
- Around line 30-37: Update the availability copy in the subscription billing
plan docs to replace watchOS with iPadOS, since the current wording in the alert
text is incorrect. Adjust the text in the Billing Plan section of
subscription-billing-plan-ios.tsx so the platform list matches Apple’s
documented availability, keeping the rest of the guidance about billingPlanType
unchanged.
In `@packages/gql/src/type-ios.graphql`:
- Around line 342-346: `RequestSubscriptionIosProps` is still out of sync with
StoreKit because `introductoryOfferEligibility` is typed as a Boolean while the
native contract now expects a JWS string; update the GraphQL schema in
`type-ios.graphql` to change that field to `compactJWS: String` before extending
the request with `billingPlanType`. Make sure the
`RequestSubscriptionIosProps`/StoreKit-facing shape stays aligned with the
native bridge so both fields use the current contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d2fdf60f-d332-494a-a151-56e428ea617e
⛔ Files ignored due to path filters (6)
packages/gql/src/generated/Types.csis excluded by!**/generated/**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.gdis excluded by!**/generated/**packages/gql/src/generated/types.tsis excluded by!**/generated/**
📒 Files selected for processing (42)
libraries/expo-iap/src/__tests__/index.test.tslibraries/expo-iap/src/types.tslibraries/flutter_inapp_purchase/lib/builders.dartlibraries/flutter_inapp_purchase/lib/types.dartlibraries/flutter_inapp_purchase/lib/utils.dartlibraries/flutter_inapp_purchase/test/builders_unit_test.dartlibraries/flutter_inapp_purchase/test/flutter_inapp_purchase_channel_test.dartlibraries/godot-iap/addons/godot-iap/godot_iap.gdlibraries/godot-iap/addons/godot-iap/types.gdlibraries/godot-iap/ios-gdextension/Sources/GodotIap/GodotIap.swiftlibraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/dsl/PurchaseDsl.ktlibraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/openiap/Types.ktlibraries/kmp-iap/library/src/commonTest/kotlin/io/github/hyochan/kmpiap/InAppPurchaseTest.ktlibraries/kmp-iap/library/src/iosMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseIOS.ktlibraries/maui-iap/src/OpenIap.Maui.Bindings.iOS/ApiDefinition.cslibraries/maui-iap/src/OpenIap.Maui/Types.cslibraries/react-native-iap/ios/HybridRnIap.swiftlibraries/react-native-iap/src/__tests__/index.test.tslibraries/react-native-iap/src/index.tslibraries/react-native-iap/src/specs/RnIap.nitro.tslibraries/react-native-iap/src/types.tspackages/apple/Sources/Helpers/StoreKitTypesBridge.swiftpackages/apple/Sources/Models/Types.swiftpackages/apple/Sources/OpenIapModule+ObjC.swiftpackages/apple/Sources/OpenIapModule.swiftpackages/apple/Sources/OpenIapStore.swiftpackages/apple/Tests/OpenIapTests.swiftpackages/docs/src/components/CodeBlock.tsxpackages/docs/src/lib/searchData.tspackages/docs/src/pages/docs/apis/request-purchase.tsxpackages/docs/src/pages/docs/features/subscription/index.tsxpackages/docs/src/pages/docs/index.tsxpackages/docs/src/pages/docs/types/index.tsxpackages/docs/src/pages/docs/types/ios/renewal-info-ios.tsxpackages/docs/src/pages/docs/types/ios/subscription-billing-plan-ios.tsxpackages/docs/src/pages/docs/types/product.tsxpackages/docs/src/pages/docs/types/purchase.tsxpackages/docs/src/pages/docs/types/request-purchase-props.tsxpackages/docs/src/pages/docs/types/subscription-product.tsxpackages/docs/src/pages/docs/updates/releases.tsxpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.ktpackages/gql/src/type-ios.graphql
There was a problem hiding this comment.
Code Review
This pull request implements support for iOS subscription commitment billing plans (StoreKit 26.4+) across the entire OpenIAP ecosystem, including React Native, Expo, Flutter, KMP, Godot, and MAUI. It introduces the SubscriptionBillingPlanTypeIOS enum, exposes pricing terms on products, tracks transaction commitment progress on purchases, and surfaces renewal commitment metadata. The documentation has been updated accordingly, and the GDScript codegen plugin was enhanced to support enum unknown fallbacks. I have no feedback to provide as no review comments were submitted.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for iOS subscription commitment billing plans (StoreKit 26.4+), allowing monthly billing with a 12-month commitment or up-front billing across React Native, Expo, Flutter, KMP, Godot, and MAUI. It also replaces the boolean-shaped introductory offer eligibility override with a compact JWS string (compactJWS). A compilation issue was identified in StoreKitTypesBridge.swift where an optional String? is passed to a non-optional parameter, which can be resolved with a fallback value.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for iOS 26.4+ subscription commitment billing plans (StoreKit 26.4) across the OpenIAP ecosystem, including React Native, Expo, Flutter, KMP, Godot, and MAUI. It adds new types and enums such as SubscriptionBillingPlanTypeIOS, SubscriptionPricingTermsIOS, TransactionCommitmentInfoIOS, and RenewalCommitmentInfoIOS to handle monthly commitments and up-front billing plans. Additionally, it replaces the boolean-shaped introductoryOfferEligibility with a compactJWS string override and updates the documentation, search data, and release notes accordingly. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
billingPlanTypethrough openiap-apple.Closes #198
Notes
dotnetis not installed in this environment, so MAUI was covered by generated type parity and source review but not a localdotnet build.Test plan
cd packages/gql && bun run generatecd packages/gql && bun testcd packages/apple && swift buildcd packages/apple && swift test --filter OpenIapTestscd libraries/react-native-iap && yarn specscd libraries/react-native-iap && yarn typecheckcd libraries/react-native-iap && yarn jest src/__tests__/index.test.ts --runInBandcd libraries/react-native-iap && yarn lintcd libraries/expo-iap && bun run lint:tsccd libraries/expo-iap && bunx jest src/__tests__/index.test.ts --runInBandcd libraries/expo-iap && bun run lintcd libraries/flutter_inapp_purchase && flutter test test/builders_unit_test.dart test/flutter_inapp_purchase_channel_test.dartcd libraries/flutter_inapp_purchase && flutter analyzecd libraries/kmp-iap && ./gradlew :library:build -x testcd libraries/godot-iap/ios-gdextension && swift buildcd packages/google && ./gradlew :openiap:compilePlayDebugKotlin :openiap:compileHorizonDebugKotlincd packages/docs && bun run format:checkcd packages/docs && bun run buildbun run audit:paritybun run audit:docsgit diff --checkSummary by CodeRabbit
monthlyandup-frontbilling-plan selection.unknownoption.