docs: cross-link wrapper SDKs + doc pages to openiap.dev API references - #107
Conversation
Comprehensive doc-comment + doc-page enrichment so every public OpenIAP API surfaces a link to its canonical reference, with iOS/Android-specific behaviour notes. Wrapper SDKs (Apple, Google, react-native-iap, expo-iap, flutter, kmp, godot): added KDoc/JSDoc/Dartdoc/Swiftdoc/GDdoc on every public API function with a one-line summary and a `@see` link to www.openiap.dev/docs/apis/<symbol>. The 5 most-used cross-platform calls (initConnection, fetchProducts, requestPurchase, finishTransaction, getAvailablePurchases) get full @param/@returns/@throws/@example blocks. Original rich docs (Apple StoreKit references, @platform tags, examples) were preserved during the merge. GraphQL schema (api.graphql, api-ios.graphql, api-android.graphql): descriptions now include the canonical doc URL, propagated to every generated Types file via codegen. Docs site (packages/docs): - API + Type pages (~70) get a one-paragraph iOS/Android behaviour blurb with links to the corresponding Apple StoreKit / Google Play Billing reference. - Mobile/tablet UI fixes: - CodeBlock language badge + Copy button rendered as a tab-bar attached to the top of the code block (no more floating overlap over horizontally scrolling code). - Mobile sidebar drawer starts below the sticky top nav (top: 56px) so taps on the drawer no longer collide with the nav's hamburger menu; z-indexes raised to 9000/9001/8999 to remove ambiguity. - Sidebar margin-left clamped to non-positive so the desktop centering offset stops shoving the sidebar to the right of the viewport in the 768-1400px tablet range. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
/gemini review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughLarge, cross‑SDK documentation and docs‑site update: JSDoc/KDoc/SwiftDoc/DartDoc/GDScript and website pages expanded to clarify platform behaviors, parameter semantics, event‑driven purchase flows, deprecations, and OpenIAP reference links. One internal change: Changes
Sequence Diagram(s)(Skipped — changes are documentation, style, and tooling; no new multi-component runtime control flow introduced that requires visualization.) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
|
CI Format check failed because the API/Type page enrichment paragraphs were inserted with hand-rolled JSX wrapping that didn't match this repo's Prettier config. Re-ran `bunx prettier --write` on the 10 flagged files; result is purely whitespace/wrap. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 14
🧹 Nitpick comments (3)
packages/docs/src/styles/documentation.css (1)
947-976: Consideroverscroll-behavior: containon the mobile drawer.The desktop sticky sidebar (line 27) has
overscroll-behavior: contain, but the mobile drawer redeclaration here doesn't. When the drawer is scrolled to top/bottom, scroll events can chain tobodyand scroll the underlying page beneath the open drawer — typically undesired for an overlay drawer.♻️ Proposed addition
overflow-y: auto; + overscroll-behavior: contain; box-sizing: border-box; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/docs/src/styles/documentation.css` around lines 947 - 976, The mobile drawer’s .docs-sidebar block lacks overscroll control so scrolling at its edges can propagate to the page underneath; update the .docs-sidebar CSS (the mobile drawer redeclaration) to include overscroll-behavior: contain to prevent scroll chaining to the body when the drawer is scrolled to the top or bottom.packages/docs/src/styles/code.css (1)
67-79: Duplicate.code-block-wrapperselectors can be merged.Lines 67-70 and 76-79 both target
.code-block-wrapper. Consider consolidating into a single block for readability.♻️ Proposed consolidation
-/* Copy button for code blocks */ .code-block-wrapper { position: relative; margin: var(--spacing-md) 0; + display: flex; + flex-direction: column; } /* Language badge + Copy button live as a tab-bar attached to the top of the code block — same background, no floating overlap with horizontally scrolling code (the previous absolute-positioned version masked code at narrow widths even with a solid background). */ -.code-block-wrapper { - display: flex; - flex-direction: column; -}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/docs/src/styles/code.css` around lines 67 - 79, Merge the duplicate .code-block-wrapper rules into a single selector by combining the properties from both blocks (position, margin, display, and flex-direction) into one consolidated .code-block-wrapper rule; remove the redundant block so there’s only one .code-block-wrapper definition (preserve the explanatory comment above the selector if needed).libraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/openiap/Types.kt (1)
4986-4989: Add@Deprecatedannotations to mark APIs as deprecated in the Kotlin type system.The
validateReceiptandvalidateReceiptIOSmethods have deprecation documented in comments, but lack@Deprecatedannotations. IDEs and compilers won't warn consumers about these methods being deprecated without the annotation.Suggested change
+ `@Deprecated`("Use verifyPurchase instead.") suspend fun validateReceipt(options: VerifyPurchaseProps): VerifyPurchaseResult /** * Verify a purchase against your own backend (returns isValid + raw store metadata). * See: https://www.openiap.dev/docs/apis/ios/validate-receipt-ios */ + `@Deprecated`("Use verifyPurchase instead.") suspend fun validateReceiptIOS(options: VerifyPurchaseProps): VerifyPurchaseResultIOS🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/openiap/Types.kt` around lines 4986 - 4989, The two deprecated suspend functions validateReceipt and validateReceiptIOS should be annotated with Kotlin's `@Deprecated` so callers receive compiler/IDE warnings; update the declarations for suspend fun validateReceipt(options: VerifyPurchaseProps): VerifyPurchaseResult and suspend fun validateReceiptIOS(options: VerifyPurchaseProps): VerifyPurchaseResult to include `@Deprecated` with a clear message (e.g., "Deprecated: use verifyPurchase instead") and, optionally, a ReplaceWith that points to verifyPurchase(...) to aid automated refactoring. Ensure annotations are placed directly above each function declaration so the Kotlin compiler recognizes them as deprecated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@libraries/godot-iap/addons/godot-iap/godot_iap.gd`:
- Around line 274-276: The docs for fetch_products claim SUBS returns
ProductSubscription instances but the implementation maps to
Types.ProductAndroid / Types.ProductIOS; pick one approach: either update the
docstring to state that fetch_products returns arrays of
Types.ProductAndroid/Types.ProductIOS (and remove mention of
ProductSubscription/Product), or change the mapper inside fetch_products to
construct and return Types.ProductSubscription wrapper objects for SUBS results
(instead of Types.ProductAndroid/Types.ProductIOS) so subscription items have
the correct wrapper type; locate the mapping logic in the fetch_products
implementation and either adjust the returned constructor/type names or update
the doc comments to precisely match Types.ProductAndroid/Types.ProductIOS
output.
- Around line 205-217: The documentation for init_connection incorrectly shows
an argument; update the docblock so it matches the actual API: remove or clarify
the example that calls init_connection(config) and any mentions of [param
config], InitConnectionConfig, enable_billing_program_android and
BillingProgramAndroid.EXTERNAL_OFFER, or explicitly state that init_connection
takes no parameters; ensure the example only shows var ok = await
iap.init_connection() and that the doc text reflects the parameter is not
supported by the current init_connection method.
In `@libraries/godot-iap/addons/godot-iap/types.gd`:
- Line 5288: Doc and enum mismatch: the verifyPurchaseWithProvider comment
mentions Apple/Google/Horizon but the PurchaseVerificationProvider enum only
defines IAPKIT; update them to be consistent. Either (A) expand the
PurchaseVerificationProvider enum (symbol name) to include APPLE, GOOGLE,
HORIZON (and update any switch/serialization/usage sites like
verifyPurchaseWithProvider to handle the new values), or (B) change the comment
on verifyPurchaseWithProvider to only list IAPKIT (or a generic "managed
provider") so it matches the current enum; pick one approach and make sure
symbols PurchaseVerificationProvider and verifyPurchaseWithProvider remain
consistent across the file.
In
`@libraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/openiap/Types.kt`:
- Around line 4991-4997: The docs claim managed verification supports "IAPKit,
Apple, Google, Horizon" but the type system (PurchaseVerificationProvider) only
exposes Iapkit and Android rejects non-Iapkit providers; update the comment
above suspend fun verifyPurchase(options: VerifyPurchaseProps):
VerifyPurchaseResult to accurately reflect the implementation: either enumerate
only the supported provider(s) (Iapkit) and note platform limitations, or extend
PurchaseVerificationProvider and platform checks to actually support
Apple/Google/Horizon; reference PurchaseVerificationProvider and verifyPurchase
when making the change so the documentation and types remain consistent.
In `@libraries/react-native-iap/src/index.ts`:
- Around line 669-670: The JSDoc for fetchProducts is missing the nullable
branch: update the return description for fetchProducts to mention that
FetchProductsResult may also be null (i.e., Promise resolving to Product[] |
ProductSubscription[] | mixed array | null), or alternatively tighten the
exported FetchProductsResult type to remove null so docs and typings match;
locate the fetchProducts declaration and the FetchProductsResult type and either
add "or null" to the doc return line or adjust the type definition accordingly.
- Around line 801-803: The JSDoc for getAvailablePurchases incorrectly states
the listed flags are iOS-only; update the PurchaseOptions documentation to
include the Android-specific flag includeSuspendedAndroid used by the
implementation. Edit the comment for getAvailablePurchases / PurchaseOptions to
list includeSuspendedAndroid (describe it briefly as an Android-only option
controlling whether suspended purchases are returned) alongside the existing iOS
flags (alsoPublishToEventListenerIOS, onlyIncludeActiveItemsIOS) so callers on
Android see the supported behavior.
In `@packages/apple/Sources/Models/Types.swift`:
- Around line 2445-2447: The doc comment for verifyPurchaseWithProvider claims
support for “IAPKit, Apple, Google, Horizon” which mismatches the actual
PurchaseVerificationProvider type surface (currently only exposes iapkit);
update the comment on the func verifyPurchaseWithProvider(_:) to list only the
providers the type supports (e.g., iapkit) or otherwise make the language
generic (e.g., “a managed provider (currently: iapkit)”) so the documentation
matches PurchaseVerificationProvider.
In `@packages/apple/Sources/OpenIapModule.swift`:
- Around line 105-107: Docstring for fetchProducts incorrectly states default
type is `.inApp` while the implementation uses `params.type ?? .all`; update the
documentation to state the default is `.all` (or alternatively change the
implementation to default to `.inApp` if that was intended). Specifically,
adjust the comment on the `fetchProducts` method / `ProductRequest` parameter to
reflect the actual default (`.all`) or change the expression `params.type ??
.all` to `params.type ?? .inApp` so docs and runtime match.
- Around line 515-520: Update the documentation for getAvailablePurchases to
accurately describe its scope: state that it lists the user's purchases held by
StoreKit and, depending on the onlyIncludeActiveItemsIOS flag, may return either
only unfinished/active transactions or the broader history (it uses
Transaction.all when onlyIncludeActiveItemsIOS is false). Mention the parameter
onlyIncludeActiveItemsIOS and that Transaction.all is consulted for the full
history so readers understand the difference in behavior.
In `@packages/docs/src/pages/docs/apis/android/launch-external-link-android.tsx`:
- Around line 25-38: Update the incorrect method name reference: replace
BillingClient.launchExternalLinkFlow(activity, params) with the correct API call
BillingClient.launchExternalLink(Activity activity, LaunchExternalLinkParams
params, LaunchExternalLinkResponseListener listener) so the prose matches the
signature used elsewhere; ensure the inline text and any surrounding
examples/reference to launchExternalLinkFlow are renamed to launchExternalLink
and, if present, mention the expected parameters/listener form to match the
signature section.
In `@packages/docs/src/pages/docs/apis/ios/present-code-redemption-sheet-ios.tsx`:
- Around line 24-25: The docs claim the wrapper maps to both
SKPaymentQueue.presentCodeRedemptionSheet() (UIKit) and
AppStore.presentOfferCodeRedeemSheet(in:) (StoreKit 2), but the implementation
in OpenIapModule.swift calls only
SKPaymentQueue.default().presentCodeRedemptionSheet(); update the sentence in
present-code-redemption-sheet-ios.tsx to reflect the actual behavior by removing
or qualifying the StoreKit 2 mention and explicitly referencing
SKPaymentQueue.default().presentCodeRedemptionSheet(), or change wording to
state that StoreKit 2 is not used/implemented here so the doc no longer implies
AppStore.presentOfferCodeRedeemSheet(in:) is invoked.
In `@packages/docs/src/pages/docs/apis/ios/show-manage-subscriptions-ios.tsx`:
- Around line 27-35: Update the documentation paragraph in
show-manage-subscriptions-ios.tsx to correctly describe the underlying native
behavior: it does not wrap AppStore.showManageSubscriptions(in:), but instead
triggers the module's deep link behavior by calling deepLinkToSubscriptions(nil)
in OpenIapModule (see OpenIapModule.swift). Rephrase the sentence to state that
the method opens the subscriptions UI via the module's deep link
(deepLinkToSubscriptions) on iOS 15+, and keep the existing Apple StoreKit
reference link for context.
In `@packages/docs/src/pages/docs/types/ios/subscription-status-ios.tsx`:
- Around line 26-39: Update the doc text for SubscriptionStatusIOS to match the
actual TypeScript type: remove the claim that it "combines transaction,
renewalInfo, and state" and instead state that the OpenIAP SubscriptionStatusIOS
exposes only renewalInfo (RenewalInfoIOS | null | undefined) and state (string);
reference the SubscriptionStatusIOS and RenewalInfoIOS types in the wording and
keep the Apple docs link as supplemental context rather than implying parity
with Apple's full Product.SubscriptionInfo.Status.
In `@packages/google/openiap/src/main/java/dev/hyo/openiap/store/OpenIapStore.kt`:
- Around line 423-425: The KDoc incorrectly references a non-existent
currentError; update the comment in OpenIapStore's purchase-flow docs to point
users to the existing APIs: instruct them to observe purchaseUpdatedListener /
purchaseErrorListener (or OpenIapStore.currentPurchase and OpenIapStore.status
with its lastError) for final state instead of currentError, ensuring the text
mentions OpenIapStore.status.lastError and OpenIapStore.currentPurchase by name.
---
Nitpick comments:
In
`@libraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/openiap/Types.kt`:
- Around line 4986-4989: The two deprecated suspend functions validateReceipt
and validateReceiptIOS should be annotated with Kotlin's `@Deprecated` so callers
receive compiler/IDE warnings; update the declarations for suspend fun
validateReceipt(options: VerifyPurchaseProps): VerifyPurchaseResult and suspend
fun validateReceiptIOS(options: VerifyPurchaseProps): VerifyPurchaseResult to
include `@Deprecated` with a clear message (e.g., "Deprecated: use verifyPurchase
instead") and, optionally, a ReplaceWith that points to verifyPurchase(...) to
aid automated refactoring. Ensure annotations are placed directly above each
function declaration so the Kotlin compiler recognizes them as deprecated.
In `@packages/docs/src/styles/code.css`:
- Around line 67-79: Merge the duplicate .code-block-wrapper rules into a single
selector by combining the properties from both blocks (position, margin,
display, and flex-direction) into one consolidated .code-block-wrapper rule;
remove the redundant block so there’s only one .code-block-wrapper definition
(preserve the explanatory comment above the selector if needed).
In `@packages/docs/src/styles/documentation.css`:
- Around line 947-976: The mobile drawer’s .docs-sidebar block lacks overscroll
control so scrolling at its edges can propagate to the page underneath; update
the .docs-sidebar CSS (the mobile drawer redeclaration) to include
overscroll-behavior: contain to prevent scroll chaining to the body when the
drawer is scrolled to the top or bottom.
🪄 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: e5a06025-77ad-40bf-9588-da0bd4afcfe5
⛔ Files ignored due to path filters (5)
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 (95)
libraries/expo-iap/src/index.tslibraries/expo-iap/src/modules/android.tslibraries/expo-iap/src/modules/ios.tslibraries/expo-iap/src/types.tslibraries/expo-iap/src/useIAP.tslibraries/flutter_inapp_purchase/lib/flutter_inapp_purchase.dartlibraries/flutter_inapp_purchase/lib/types.dartlibraries/godot-iap/addons/godot-iap/godot_iap.gdlibraries/godot-iap/addons/godot-iap/types.gdlibraries/kmp-iap/library/src/androidMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseAndroid.ktlibraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/openiap/Types.ktlibraries/kmp-iap/library/src/iosMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseIOS.ktlibraries/react-native-iap/src/hooks/useIAP.tslibraries/react-native-iap/src/index.tslibraries/react-native-iap/src/types.tspackages/apple/Sources/Models/Types.swiftpackages/apple/Sources/OpenIapModule.swiftpackages/docs/src/pages/docs/apis/android/acknowledge-purchase-android.tsxpackages/docs/src/pages/docs/apis/android/check-alternative-billing-availability-android.tsxpackages/docs/src/pages/docs/apis/android/consume-purchase-android.tsxpackages/docs/src/pages/docs/apis/android/create-alternative-billing-token-android.tsxpackages/docs/src/pages/docs/apis/android/create-billing-program-reporting-details-android.tsxpackages/docs/src/pages/docs/apis/android/enable-billing-program-android.tsxpackages/docs/src/pages/docs/apis/android/is-billing-program-available-android.tsxpackages/docs/src/pages/docs/apis/android/launch-external-link-android.tsxpackages/docs/src/pages/docs/apis/android/show-alternative-billing-dialog-android.tsxpackages/docs/src/pages/docs/apis/deep-link-to-subscriptions.tsxpackages/docs/src/pages/docs/apis/end-connection.tsxpackages/docs/src/pages/docs/apis/fetch-products.tsxpackages/docs/src/pages/docs/apis/finish-transaction.tsxpackages/docs/src/pages/docs/apis/get-active-subscriptions.tsxpackages/docs/src/pages/docs/apis/get-available-purchases.tsxpackages/docs/src/pages/docs/apis/get-storefront.tsxpackages/docs/src/pages/docs/apis/has-active-subscriptions.tsxpackages/docs/src/pages/docs/apis/init-connection.tsxpackages/docs/src/pages/docs/apis/ios/begin-refund-request-ios.tsxpackages/docs/src/pages/docs/apis/ios/can-present-external-purchase-notice-ios.tsxpackages/docs/src/pages/docs/apis/ios/clear-transaction-ios.tsxpackages/docs/src/pages/docs/apis/ios/current-entitlement-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-all-transactions-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-app-transaction-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-external-purchase-custom-link-token-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-pending-transactions-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-promoted-product-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-receipt-data-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-storefront-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-transaction-jws-ios.tsxpackages/docs/src/pages/docs/apis/ios/is-eligible-for-external-purchase-custom-link-ios.tsxpackages/docs/src/pages/docs/apis/ios/is-eligible-for-intro-offer-ios.tsxpackages/docs/src/pages/docs/apis/ios/is-transaction-verified-ios.tsxpackages/docs/src/pages/docs/apis/ios/latest-transaction-ios.tsxpackages/docs/src/pages/docs/apis/ios/present-code-redemption-sheet-ios.tsxpackages/docs/src/pages/docs/apis/ios/present-external-purchase-link-ios.tsxpackages/docs/src/pages/docs/apis/ios/present-external-purchase-notice-sheet-ios.tsxpackages/docs/src/pages/docs/apis/ios/request-purchase-on-promoted-product-ios.tsxpackages/docs/src/pages/docs/apis/ios/show-external-purchase-custom-link-notice-ios.tsxpackages/docs/src/pages/docs/apis/ios/show-manage-subscriptions-ios.tsxpackages/docs/src/pages/docs/apis/ios/subscription-status-ios.tsxpackages/docs/src/pages/docs/apis/ios/sync-ios.tsxpackages/docs/src/pages/docs/apis/ios/validate-receipt-ios.tsxpackages/docs/src/pages/docs/apis/request-purchase.tsxpackages/docs/src/pages/docs/apis/restore-purchases.tsxpackages/docs/src/pages/docs/types/active-subscription.tsxpackages/docs/src/pages/docs/types/alternative-billing-types.tsxpackages/docs/src/pages/docs/types/android/one-time-purchase-offer-detail-android.tsxpackages/docs/src/pages/docs/types/android/pricing-phase-android.tsxpackages/docs/src/pages/docs/types/android/subscription-offer-android.tsxpackages/docs/src/pages/docs/types/billing-programs.tsxpackages/docs/src/pages/docs/types/discount-offer.tsxpackages/docs/src/pages/docs/types/external-purchase-link.tsxpackages/docs/src/pages/docs/types/ios/app-transaction-ios.tsxpackages/docs/src/pages/docs/types/ios/discount-ios.tsxpackages/docs/src/pages/docs/types/ios/discount-offer-ios.tsxpackages/docs/src/pages/docs/types/ios/payment-mode-ios.tsxpackages/docs/src/pages/docs/types/ios/renewal-info-ios.tsxpackages/docs/src/pages/docs/types/ios/subscription-period-ios.tsxpackages/docs/src/pages/docs/types/ios/subscription-status-ios.tsxpackages/docs/src/pages/docs/types/product-request.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/storefront.tsxpackages/docs/src/pages/docs/types/subscription-offer.tsxpackages/docs/src/pages/docs/types/subscription-product.tsxpackages/docs/src/pages/docs/types/verify-purchase-with-provider-props.tsxpackages/docs/src/pages/docs/types/verify-purchase-with-provider-result.tsxpackages/docs/src/pages/docs/types/verify-purchase.tsxpackages/docs/src/styles/code.csspackages/docs/src/styles/documentation.csspackages/docs/src/styles/responsive.csspackages/google/openiap/src/main/java/dev/hyo/openiap/Types.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/store/OpenIapStore.ktpackages/gql/src/api-android.graphqlpackages/gql/src/api-ios.graphqlpackages/gql/src/api.graphql
Fixes 14 unresolved review threads on PR #107: - Provider list — `verifyPurchaseWithProvider` docs claimed support for IAPKit/Apple/Google/Horizon but `PurchaseVerificationProvider` only exposes `IAPKit`. Tightened the GraphQL schema description (so all generated Types files re-flow on next codegen) and updated every hand-written wrapper doc + the `apis` listing page + the `verify-purchase-with-provider-props` type page. - Apple `fetchProducts` doc default `.inApp` → `.all` to match the implementation's `params.type ?? .all`. - Apple `getAvailablePurchases` doc no longer claims "unfinished only"; describes the `Transaction.all` (default) vs `Transaction.currentEntitlements` (when `onlyIncludeActiveItemsIOS`) branches. - Godot `init_connection` doc dropped the bogus `config` parameter — the GDScript wrapper currently takes no arguments. - Godot `fetch_products` return-type doc corrected to reflect the wrapper output (`ProductAndroid`/`ProductIOS`, not `ProductSubscription`). - react-native-iap `fetchProducts` `@returns` mentions the nullable branch from `FetchProductsResult`. - react-native-iap `getAvailablePurchases` `@param options` documents the Android-only `includeSuspendedAndroid` flag. - launch-external-link-android.tsx: `BillingClient.launchExternalLinkFlow` → `BillingClient.launchExternalLink(activity, params, listener)` (matches the Play Billing 8.2.0+ API). - present-code-redemption-sheet-ios.tsx: drop the StoreKit 2 `AppStore.presentOfferCodeRedeemSheet(in:)` mention; the wrapper only calls `SKPaymentQueue.default().presentCodeRedemptionSheet()`. - show-manage-subscriptions-ios.tsx: clarify that the wrapper forwards to `deepLinkToSubscriptions(nil)` (which itself reaches `AppStore.showManageSubscriptions(in:)` when a window scene exists). - subscription-status-ios.tsx (type doc): the OpenIAP wrapper exposes only `renewalInfo` + `state`, not Apple's full `transaction` field. - packages/google `OpenIapStore.kt`: replaced the broken `currentError` reference with `OpenIapStore.status.lastError`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/gemini review |
|
@coderabbitai review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Pull request overview
This PR standardizes cross-linking between wrapper SDK APIs / generated GraphQL types and the openiap.dev API reference pages, while also updating the docs site with platform-behavior blurbs and a few responsive layout fixes.
Changes:
- Add canonical
See: https://www.openiap.dev/docs/apis/...links + expanded doc comments/descriptions across GraphQL schema and generated client types (TS/Dart/Swift/Kotlin). - Add/expand docs-site API + Type pages with iOS/Android behavior notes and native reference links.
- Fix docs-site mobile/tablet UI issues (sidebar drawer layering/positioning; code block header/badge layout).
Reviewed changes
Copilot reviewed 96 out of 101 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/gql/src/generated/types.ts | Generated TS types: expanded field docstrings with canonical openiap.dev links. |
| packages/gql/src/generated/types.dart | Generated Dart types: expanded API doc comments with canonical openiap.dev links. |
| packages/gql/src/generated/Types.swift | Generated Swift types: expanded protocol doc comments with canonical openiap.dev links. |
| packages/gql/src/generated/Types.kt | Generated Kotlin types: expanded resolver doc comments with canonical openiap.dev links. |
| packages/gql/src/api.graphql | GraphQL schema: improved root API descriptions + canonical openiap.dev links. |
| packages/gql/src/api-ios.graphql | iOS schema extensions: improved descriptions + canonical openiap.dev links. |
| packages/gql/src/api-android.graphql | Android schema extensions: improved descriptions + canonical openiap.dev links. |
| packages/google/openiap/src/main/java/dev/hyo/openiap/store/OpenIapStore.kt | Adds KDoc for core store operations and links to openiap.dev reference pages. |
| packages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt | Kotlin types/protocol docs updated with canonical openiap.dev links. |
| packages/docs/src/styles/responsive.css | Removes conflicting mobile sidebar rules; defers to documentation.css mobile drawer styling. |
| packages/docs/src/styles/documentation.css | Fixes sidebar centering offset on tablet; adjusts mobile drawer/overlay z-index and top offset below sticky nav. |
| packages/docs/src/styles/code.css | Reworks code block header/badge as attached “tab bar” instead of absolute overlay. |
| packages/docs/src/pages/docs/types/verify-purchase.tsx | Adds platform behavior blurb + native doc links for verifyPurchase types. |
| packages/docs/src/pages/docs/types/verify-purchase-with-provider-result.tsx | Adds clarification + link to Validation docs. |
| packages/docs/src/pages/docs/types/verify-purchase-with-provider-props.tsx | Adds clarification + link to Validation docs. |
| packages/docs/src/pages/docs/types/subscription-product.tsx | Adds platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/types/subscription-offer.tsx | Adds platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/types/storefront.tsx | Adds platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/types/request-purchase-props.tsx | Adds platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/types/purchase.tsx | Adds platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/types/product.tsx | Adds platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/types/product-request.tsx | Adds platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/types/ios/subscription-status-ios.tsx | Clarifies wrapper projection vs Apple type for SubscriptionStatusIOS. |
| packages/docs/src/pages/docs/types/ios/subscription-period-ios.tsx | Adds iOS-only mapping blurb + Apple reference link. |
| packages/docs/src/pages/docs/types/ios/renewal-info-ios.tsx | Adds iOS-only mapping blurb + Apple reference link. |
| packages/docs/src/pages/docs/types/ios/payment-mode-ios.tsx | Adds iOS-only mapping blurb + Apple reference link. |
| packages/docs/src/pages/docs/types/ios/discount-offer-ios.tsx | Adds iOS-only mapping blurb + Apple reference link. |
| packages/docs/src/pages/docs/types/ios/discount-ios.tsx | Adds iOS-only mapping blurb + Apple reference link. |
| packages/docs/src/pages/docs/types/ios/app-transaction-ios.tsx | Adds iOS-only mapping blurb + Apple reference link. |
| packages/docs/src/pages/docs/types/external-purchase-link.tsx | Adds iOS external purchase type/context + links; includes availability table. |
| packages/docs/src/pages/docs/types/discount-offer.tsx | Adds cross-platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/types/billing-programs.tsx | Adds Android-only mapping blurb + Google reference link. |
| packages/docs/src/pages/docs/types/android/subscription-offer-android.tsx | Adds Android-only mapping blurb + Google reference link. |
| packages/docs/src/pages/docs/types/android/pricing-phase-android.tsx | Adds Android-only mapping blurb + Google reference link. |
| packages/docs/src/pages/docs/types/android/one-time-purchase-offer-detail-android.tsx | Adds Android-only mapping blurb + Google reference link. |
| packages/docs/src/pages/docs/types/alternative-billing-types.tsx | Adds Android-only mapping blurb + Google reference link. |
| packages/docs/src/pages/docs/types/active-subscription.tsx | Adds cross-platform mapping blurb + Apple/Google reference links. |
| packages/docs/src/pages/docs/apis/restore-purchases.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/request-purchase.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/ios/validate-receipt-ios.tsx | Adds deprecation context + Apple legacy reference link. |
| packages/docs/src/pages/docs/apis/ios/sync-ios.tsx | Adds wrapper behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/subscription-status-ios.tsx | Adds wrapper behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/show-manage-subscriptions-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/show-external-purchase-custom-link-notice-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/request-purchase-on-promoted-product-ios.tsx | Adds deprecation context + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/present-external-purchase-notice-sheet-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/present-external-purchase-link-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/present-code-redemption-sheet-ios.tsx | Adds StoreKit 1 vs 2 context + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/latest-transaction-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/is-transaction-verified-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/is-eligible-for-intro-offer-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/is-eligible-for-external-purchase-custom-link-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/get-transaction-jws-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/get-storefront-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/get-receipt-data-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/get-promoted-product-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/get-pending-transactions-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/get-external-purchase-custom-link-token-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/get-app-transaction-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/get-all-transactions-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/current-entitlement-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/clear-transaction-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/can-present-external-purchase-notice-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/ios/begin-refund-request-ios.tsx | Adds behavior description + Apple reference link. |
| packages/docs/src/pages/docs/apis/init-connection.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/index.tsx | Updates verifyPurchaseWithProvider index description to match current enum. |
| packages/docs/src/pages/docs/apis/has-active-subscriptions.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/get-storefront.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/get-available-purchases.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/get-active-subscriptions.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/finish-transaction.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/fetch-products.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/end-connection.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/deep-link-to-subscriptions.tsx | Adds iOS/Android behavior blurb + native reference links. |
| packages/docs/src/pages/docs/apis/android/show-alternative-billing-dialog-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/docs/src/pages/docs/apis/android/launch-external-link-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/docs/src/pages/docs/apis/android/is-billing-program-available-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/docs/src/pages/docs/apis/android/enable-billing-program-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/docs/src/pages/docs/apis/android/create-billing-program-reporting-details-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/docs/src/pages/docs/apis/android/create-alternative-billing-token-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/docs/src/pages/docs/apis/android/consume-purchase-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/docs/src/pages/docs/apis/android/check-alternative-billing-availability-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/docs/src/pages/docs/apis/android/acknowledge-purchase-android.tsx | Adds wrapper behavior description + Google reference link. |
| packages/apple/Sources/Models/Types.swift | Apple package generated types/protocol docs updated with canonical openiap.dev links. |
| libraries/react-native-iap/src/types.ts | RN wrapper types: expanded JSDoc + canonical openiap.dev links. |
| libraries/react-native-iap/src/hooks/useIAP.ts | RN hook API: adds detailed JSDoc for core functions + links. |
| libraries/flutter_inapp_purchase/lib/types.dart | Flutter wrapper types: expanded doc comments + canonical openiap.dev links. |
| libraries/expo-iap/src/useIAP.ts | Expo hook: adds detailed JSDoc for core functions + links. |
| libraries/expo-iap/src/types.ts | Expo wrapper types: expanded JSDoc + canonical openiap.dev links. |
| libraries/expo-iap/src/modules/ios.ts | Expo iOS module exports: adds @see links to openiap.dev API pages. |
| libraries/expo-iap/src/modules/android.ts | Expo Android module exports: adds @see links to openiap.dev API pages. |
| libraries/expo-iap/src/index.ts | Expo top-level API exports: expands JSDoc for core funcs + canonical openiap.dev links. |
Comments suppressed due to low confidence (1)
packages/docs/src/pages/docs/types/external-purchase-link.tsx:109
- This page says external purchase "custom links" (and
presentExternalPurchaseLinkIOSin the table) are available from iOS 18.2+, but the Apple wrapper markspresentExternalPurchaseLinkIOSas iOS 16+. Please align the availability text/table with the actual API (or document what specifically requires 18.2+).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- subscriptionStatusIOS API page (apis/ios/subscription-status-ios.tsx): the 'Wraps Product.SubscriptionInfo.status' paragraph was still claiming the wrapper exposes `transaction`, even after the type page was corrected last round. Updated to say only `renewalInfo` + `state` are surfaced and to point users at `latestTransactionIOS(sku)` if they need the underlying transaction. - useIAP `getAvailablePurchases` JSDoc: the `@example` had a `const purchases = await getAvailablePurchases()` snippet that contradicts the `Promise<void>` signature (results land in the reactive `availablePurchases` array per the hook semantics in CLAUDE.md). Replaced with a hook-state pattern. Same fix applied preemptively to the `fetchProducts` example for consistency. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/gemini review |
|
@coderabbitai review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
libraries/kmp-iap/library/src/androidMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseAndroid.kt (1)
580-687: Consider noting Android-stub status on iOS-only overrides.These overrides (
currentEntitlementIOS,getAppTransactionIOS,getPendingTransactionsIOS,subscriptionStatusIOS,getStorefrontIOS,presentCodeRedemptionSheetIOS,getPromotedProductIOS,showManageSubscriptionsIOS,syncIOS, etc.) all return harmless defaults (null/false/emptyList()) on Android, but the new KDocs only describe iOS behavior — readers viewing the Android implementation may miss that these are no-ops. A one-lineReturns a no-op default on Android.would prevent surprise.This is a stylistic refinement, not a correctness defect — the iOS-suffix naming already conveys platform scope.
Also applies to: 1020-1078
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libraries/kmp-iap/library/src/androidMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseAndroid.kt` around lines 580 - 687, Several iOS-only APIs in InAppPurchaseAndroid (e.g., currentEntitlementIOS, getAppTransactionIOS, getPendingTransactionsIOS, getAllTransactionsIOS, getReceiptDataIOS, getTransactionJwsIOS, isEligibleForIntroOfferIOS, isEligibleForExternalPurchaseCustomLinkIOS, showExternalPurchaseCustomLinkNoticeIOS, getExternalPurchaseCustomLinkTokenIOS, isTransactionVerifiedIOS, latestTransactionIOS, subscriptionStatusIOS and other iOS-suffixed overrides) return harmless defaults on Android but their KDoc only describes iOS behavior; update each method's KDoc to add a single clarifying sentence such as "Returns a no-op default on Android." so readers of the Android implementation understand these are intentional no-ops, leaving the implementation unchanged.libraries/react-native-iap/src/types.ts (1)
696-705: Duplicate@deprecatedtags (pre-existing pattern, FYI).
requestPurchaseOnPromotedProductIOScarries two@deprecatedannotations (lines 699 and 703) with different wording. Several other fields show the same pattern (subscriptionInfoIOS,oneTimePurchaseOfferDetailsAndroid,subscriptionOfferDetailsAndroid,discountsIOS). This appears to be a generator artifact emitting both the schema's@deprecatedreason and a redundant doc-comment line. Not introduced by this PR, but worth cleaning up in the generator templates so downstream tooling (TypeDoc, IDEs) doesn't render the tag twice.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libraries/react-native-iap/src/types.ts` around lines 696 - 705, The doc comments contain duplicate `@deprecated` tags for several exported types (e.g., requestPurchaseOnPromotedProductIOS, subscriptionInfoIOS, oneTimePurchaseOfferDetailsAndroid, subscriptionOfferDetailsAndroid, discountsIOS); locate the generator/template that emits both the schema's deprecation reason and an extra doc line and change it to emit a single `@deprecated` annotation (merge the messages if needed) so each field/type has only one `@deprecated` tag in the generated types; update the template logic that builds the JSDoc to skip adding an additional `@deprecated` when a schema-provided deprecation string already exists.libraries/react-native-iap/src/index.ts (2)
1501-1526: Tighten the "Synchronous rejection" wording forrequestPurchase.
requestPurchaseisasync, so all errors surface as promise rejections — not literally "synchronous". The intent (these errors reach the caller viathrow/rejection rather than the purchase event listener) is clearer with a small reword.✏️ Suggested doc tweak
- * `@throws` Synchronous rejection from the store (e.g. `E_NOT_PREPARED`, validation failure). + * `@throws` Rejects when the store rejects the request before dispatch + * (e.g. `E_NOT_PREPARED`, validation failure). Successful purchase outcomes are + * delivered through `purchaseUpdatedListener`, not via this promise.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libraries/react-native-iap/src/index.ts` around lines 1501 - 1526, Update the JSDoc for requestPurchase to clarify that errors are returned as promise rejections rather than "synchronous" exceptions: reword the "@throws" line to say that the function may reject its returned Promise with store errors (e.g., E_NOT_PREPARED, validation failure) and that these rejections are delivered to the caller rather than via the purchase event listeners; adjust any surrounding wording that refers to "synchronous rejection" to mention "immediate Promise rejection" or similar. Reference: requestPurchase in the existing comment block and the "@throws" tag.
1413-1431:initConnectionJSDoc — clarify the preferred billing program setup approach.The JSDoc example correctly shows passing
enableBillingProgramAndroidviaInitConnectionConfig, which is the modern, recommended approach. However, a standaloneenableBillingProgramAndroid(program)function also exists in the same module that must be called BEFOREinitConnection()(visible at line 2752). To prevent confusion, consider adding a remark that the config approach shown in the example is preferred, or add a cross-reference noting the two setup patterns and when each is appropriate.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libraries/react-native-iap/src/index.ts` around lines 1413 - 1431, Update the initConnection JSDoc to clarify billing-program setup: state that passing enableBillingProgramAndroid via InitConnectionConfig (as shown in the example) is the preferred modern approach and mention the alternative standalone function enableBillingProgramAndroid(program) also exists and must be called before initConnection() if used; add a short cross-reference to useIAP (which auto-manages connection) and to the standalone enableBillingProgramAndroid to avoid confusion about ordering and preferred usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@libraries/kmp-iap/library/src/androidMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseAndroid.kt`:
- Around line 522-537: Update the KDoc on the requestPurchase override to use
the correct parameter name and clarify inner-field paths: change "@param props"
to "@param request" and rewrite references like "`request.apple.sku`" to
explicitly indicate the field on RequestPurchaseProps (e.g.,
"request.request.apple.sku" or better "RequestPurchaseProps.request.apple.sku")
so IDE/Dokka can resolve them; ensure the thrown/return tags and summary remain
intact and reference the requestPurchase function and RequestPurchaseProps type
where applicable.
In
`@libraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/openiap/Types.kt`:
- Around line 4991-4994: The doc for suspend fun verifyPurchase(options:
VerifyPurchaseProps): VerifyPurchaseResult is too strict by claiming the result
"returns isValid"; update the comment to say that VerifyPurchaseResult is a
union type and that an isValid field is present only on some variants (e.g.,
VerifyPurchaseResultAndroid, VerifyPurchaseResultHorizon), or otherwise describe
the possible variant shapes and advise callers to inspect the concrete variant
before reading isValid; reference verifyPurchase, VerifyPurchaseResult,
VerifyPurchaseResultAndroid, and VerifyPurchaseResultHorizon in the revised
wording.
---
Nitpick comments:
In
`@libraries/kmp-iap/library/src/androidMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseAndroid.kt`:
- Around line 580-687: Several iOS-only APIs in InAppPurchaseAndroid (e.g.,
currentEntitlementIOS, getAppTransactionIOS, getPendingTransactionsIOS,
getAllTransactionsIOS, getReceiptDataIOS, getTransactionJwsIOS,
isEligibleForIntroOfferIOS, isEligibleForExternalPurchaseCustomLinkIOS,
showExternalPurchaseCustomLinkNoticeIOS, getExternalPurchaseCustomLinkTokenIOS,
isTransactionVerifiedIOS, latestTransactionIOS, subscriptionStatusIOS and other
iOS-suffixed overrides) return harmless defaults on Android but their KDoc only
describes iOS behavior; update each method's KDoc to add a single clarifying
sentence such as "Returns a no-op default on Android." so readers of the Android
implementation understand these are intentional no-ops, leaving the
implementation unchanged.
In `@libraries/react-native-iap/src/index.ts`:
- Around line 1501-1526: Update the JSDoc for requestPurchase to clarify that
errors are returned as promise rejections rather than "synchronous" exceptions:
reword the "@throws" line to say that the function may reject its returned
Promise with store errors (e.g., E_NOT_PREPARED, validation failure) and that
these rejections are delivered to the caller rather than via the purchase event
listeners; adjust any surrounding wording that refers to "synchronous rejection"
to mention "immediate Promise rejection" or similar. Reference: requestPurchase
in the existing comment block and the "@throws" tag.
- Around line 1413-1431: Update the initConnection JSDoc to clarify
billing-program setup: state that passing enableBillingProgramAndroid via
InitConnectionConfig (as shown in the example) is the preferred modern approach
and mention the alternative standalone function
enableBillingProgramAndroid(program) also exists and must be called before
initConnection() if used; add a short cross-reference to useIAP (which
auto-manages connection) and to the standalone enableBillingProgramAndroid to
avoid confusion about ordering and preferred usage.
In `@libraries/react-native-iap/src/types.ts`:
- Around line 696-705: The doc comments contain duplicate `@deprecated` tags for
several exported types (e.g., requestPurchaseOnPromotedProductIOS,
subscriptionInfoIOS, oneTimePurchaseOfferDetailsAndroid,
subscriptionOfferDetailsAndroid, discountsIOS); locate the generator/template
that emits both the schema's deprecation reason and an extra doc line and change
it to emit a single `@deprecated` annotation (merge the messages if needed) so
each field/type has only one `@deprecated` tag in the generated types; update the
template logic that builds the JSDoc to skip adding an additional `@deprecated`
when a schema-provided deprecation string already exists.
🪄 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: 32d58be1-9d67-4260-9b61-714c63884175
⛔ Files ignored due to path filters (5)
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 (33)
libraries/expo-iap/src/types.tslibraries/expo-iap/src/useIAP.tslibraries/flutter_inapp_purchase/lib/flutter_inapp_purchase.dartlibraries/flutter_inapp_purchase/lib/types.dartlibraries/godot-iap/addons/godot-iap/godot_iap.gdlibraries/godot-iap/addons/godot-iap/types.gdlibraries/kmp-iap/library/src/androidMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseAndroid.ktlibraries/kmp-iap/library/src/commonMain/kotlin/io/github/hyochan/kmpiap/openiap/Types.ktlibraries/kmp-iap/library/src/iosMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseIOS.ktlibraries/react-native-iap/src/hooks/useIAP.tslibraries/react-native-iap/src/index.tslibraries/react-native-iap/src/types.tspackages/apple/Sources/Models/Types.swiftpackages/apple/Sources/OpenIapModule.swiftpackages/docs/src/pages/docs/apis/android/acknowledge-purchase-android.tsxpackages/docs/src/pages/docs/apis/android/check-alternative-billing-availability-android.tsxpackages/docs/src/pages/docs/apis/android/is-billing-program-available-android.tsxpackages/docs/src/pages/docs/apis/android/launch-external-link-android.tsxpackages/docs/src/pages/docs/apis/deep-link-to-subscriptions.tsxpackages/docs/src/pages/docs/apis/finish-transaction.tsxpackages/docs/src/pages/docs/apis/get-active-subscriptions.tsxpackages/docs/src/pages/docs/apis/index.tsxpackages/docs/src/pages/docs/apis/ios/is-eligible-for-intro-offer-ios.tsxpackages/docs/src/pages/docs/apis/ios/present-code-redemption-sheet-ios.tsxpackages/docs/src/pages/docs/apis/ios/show-manage-subscriptions-ios.tsxpackages/docs/src/pages/docs/apis/ios/subscription-status-ios.tsxpackages/docs/src/pages/docs/apis/restore-purchases.tsxpackages/docs/src/pages/docs/types/ios/subscription-status-ios.tsxpackages/docs/src/pages/docs/types/subscription-offer.tsxpackages/docs/src/pages/docs/types/verify-purchase-with-provider-props.tsxpackages/google/openiap/src/main/java/dev/hyo/openiap/Types.ktpackages/google/openiap/src/main/java/dev/hyo/openiap/store/OpenIapStore.ktpackages/gql/src/api.graphql
✅ Files skipped from review due to trivial changes (27)
- packages/docs/src/pages/docs/apis/android/check-alternative-billing-availability-android.tsx
- packages/docs/src/pages/docs/apis/ios/is-eligible-for-intro-offer-ios.tsx
- packages/docs/src/pages/docs/types/subscription-offer.tsx
- packages/docs/src/pages/docs/apis/android/acknowledge-purchase-android.tsx
- packages/docs/src/pages/docs/apis/android/is-billing-program-available-android.tsx
- packages/docs/src/pages/docs/apis/index.tsx
- packages/docs/src/pages/docs/apis/restore-purchases.tsx
- packages/docs/src/pages/docs/apis/ios/present-code-redemption-sheet-ios.tsx
- packages/docs/src/pages/docs/apis/finish-transaction.tsx
- packages/docs/src/pages/docs/apis/deep-link-to-subscriptions.tsx
- packages/docs/src/pages/docs/types/verify-purchase-with-provider-props.tsx
- packages/docs/src/pages/docs/apis/ios/show-manage-subscriptions-ios.tsx
- packages/docs/src/pages/docs/apis/get-active-subscriptions.tsx
- packages/docs/src/pages/docs/types/ios/subscription-status-ios.tsx
- packages/apple/Sources/Models/Types.swift
- packages/docs/src/pages/docs/apis/android/launch-external-link-android.tsx
- packages/docs/src/pages/docs/apis/ios/subscription-status-ios.tsx
- packages/google/openiap/src/main/java/dev/hyo/openiap/Types.kt
- libraries/expo-iap/src/useIAP.ts
- libraries/flutter_inapp_purchase/lib/types.dart
- libraries/react-native-iap/src/hooks/useIAP.ts
- packages/google/openiap/src/main/java/dev/hyo/openiap/store/OpenIapStore.kt
- libraries/godot-iap/addons/godot-iap/godot_iap.gd
- libraries/kmp-iap/library/src/iosMain/kotlin/io/github/hyochan/kmpiap/InAppPurchaseIOS.kt
- packages/apple/Sources/OpenIapModule.swift
- libraries/godot-iap/addons/godot-iap/types.gd
- libraries/flutter_inapp_purchase/lib/flutter_inapp_purchase.dart
🚧 Files skipped from review as they are similar to previous changes (1)
- libraries/expo-iap/src/types.ts
- KMP requestPurchase KDoc parameter name mismatch — `@param props`
but the actual method parameter is `request` (Android) / `params`
(iOS). Renamed each `@param` to match its actual signature and
clarified the OUTER vs INNER `request` field path
(`<param>.request.apple.sku` etc.) so Dokka/IDE tooling stop
warning about "missing parameter docs".
- `verifyPurchase` schema description was overly iOS-biased ("returns
isValid + raw store metadata"), but `VerifyPurchaseResult` is a
union — only `VerifyPurchaseResultIOS` exposes `isValid`,
`VerifyPurchaseResultAndroid` carries Play Store fields with no
isValid, and `VerifyPurchaseResultHorizon` uses `success`. Updated
the GraphQL schema description to describe each variant; codegen
re-flowed all generated Types files.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/gemini review |
|
@coderabbitai review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
✅ Actions performedReview triggered.
|
- CodeBlock.tsx: linkifyTypesInTextSegments was still wrapping text
inside existing keyword/function spans because splitting on
`<...>` boundaries doesn't tell you whether you're INSIDE a tag.
Added a depth counter so capitals are only linkified at depth 0 —
Dart `Future`, GDScript `String`, etc. now keep their keyword color
instead of getting nested under a class-name span.
- is-billing-program-available-android.tsx: Returns table fields
corrected to match the canonical `BillingProgramAvailabilityResultAndroid`
type (`billingProgram` + `isAvailable`); removed the
`responseCode`/`debugMessage` rows that were pure invention.
- launch-external-link-android.tsx: Parameters list and TS/Dart/GDScript
examples used non-existent `program` and `url` fields. Replaced
with the real `LaunchExternalLinkParamsAndroid` shape:
`billingProgram` + `launchMode` + `linkType` + `linkUri`.
- get-available-purchases.tsx: aligned `includeSuspendedAndroid`
description with schema wording — "suspended subscriptions
(Android Billing 8.1+)" + warning that suspended entries must NOT
grant entitlements.
- get-storefront.tsx: folded the orphan trailing
"empty string when storefront can't be determined" paragraph into
the Returns section so anchor-linkers see the full contract.
- init-connection.tsx: clarified that
`enableBillingProgramAndroid: 'external-payments'` needs Play
Billing 8.3.0+ (Japan only); the 8.2.0+ programs are
`EXTERNAL_CONTENT_LINK` / `EXTERNAL_OFFER`.
- begin-refund-request-ios.tsx: GDScript signature corrected to
`(product_id: String) -> Types.RefundResultIOS` (was `(sku) ->
Variant`); GDScript example dropped the `await` because the impl
is synchronous; TS example now imports `Platform` from
`react-native`.
- is-eligible-for-intro-offer-ios.tsx: TypeScript signature uses
`groupId` (camelCase wrapper) while keeping `groupID` (Swift
convention) on the Swift / Kotlin tabs; Parameters note explains
the discrepancy.
- present-code-redemption-sheet-ios.tsx + sync-ios.tsx: GDScript
`-> Variant` corrected to `-> Types.VoidResult` (matches the
godot-iap docstring + actual return).
- show-external-purchase-custom-link-notice-ios.tsx + the External
Purchase Link type page: rewrote the Notice noticeType + result
shape — the only valid `ExternalPurchaseCustomLinkNoticeTypeIOS`
is `'browser'` (Apple's canonical name), and the result is
`{ continued: boolean; error?: string }`, not the invented
`result: 'continue' | 'cancelled'` + `noticeType` echo.
- restore-purchases.tsx: rewrote the iOS sentence — `restorePurchases`
delegates to `syncIOS()` which calls `AppStore.sync()` to refresh
StoreKit's transaction state; restored purchases are then read via
`getAvailablePurchases`. Android docs anchor changed from `#fetch`
(doesn't exist on the integration page) to the integration page
itself.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/gemini review |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
…moval The previous commit left a blank-line/whitespace artifact after deleting the trailing 'empty string when storefront can't be determined' paragraph. CI Format Check caught it; running `bunx prettier --write` cleans up. Will tighten the per-file pre-commit checklist by running prettier locally on every touched file before pushing — should have caught this before the CI job ran. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request comprehensively updates API documentation across all supported platforms by adding detailed descriptions, examples, and deep links to the official documentation site. It also enhances the documentation site with automatic type-linkification in code blocks and various CSS layout fixes for mobile viewports. Feedback focuses on maintaining SDK parity by aligning the default product query type on iOS with other platforms, correcting parameter name mismatches in JSDoc signatures, and ensuring GDScript return types in the documentation accurately reflect the underlying implementation.
…godot return types - packages/apple OpenIapModule.swift: fetchProducts default `.all` → `.inApp` for SDK parity. Flutter, expo-iap, react-native-iap, and godot-iap all default to `'in-app'` already; Apple was the outlier per Gemini's audit. Updated both the doc comment and the `params.type ?? .all` fallback. swift build passes. - expo-iap src/index.ts: JSDoc parameter names now match the actual destructured / forwarded names — `fetchProducts(@PARAM request)` (was `params`), `requestPurchase(@PARAM args)` (was `props`). - react-native-iap src/index.ts: same fix — `fetchProducts(@PARAM request)` and `requestPurchase(@PARAM request)`. - 4 iOS doc pages: GDScript signatures with sloppy `-> Variant` fixed to the real return type from `godot-iap/addons/godot-iap/godot_iap.gd`: - can-present-external-purchase-notice-ios → `bool` - is-transaction-verified-ios → `bool` - get-transaction-jws-ios → `String` - get-receipt-data-ios → `String` Pre-commit checks now run cleanly: prettier --check passes, vite build passes, expo-iap tsc passes, swift build passes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/gemini review |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Code Review
This pull request implements a monorepo-wide documentation update, adding direct links to the official documentation and improving JSDoc, KDoc, DartDoc, and GDScript comments across all SDKs and core platform packages. It also enhances the documentation site by adding automatic linkification of OpenIAP types in code blocks and fixing various CSS issues related to sidebar positioning and table responsiveness. Additionally, it aligns the Apple SDK's default product fetch type with other platforms by changing it to .inApp. I have no feedback to provide.
Two follow-ups to the user's PR #107 polish round: 1. Mobile drawer overlay was rgba(0,0,0,0.5) with a 2px blur. On long pages (especially with code blocks behind), readers could still make out the page content under the dimmed strip and misread it as a z-index bug. Pushed alpha to 0.78 and blur to 6px (with the `-webkit-backdrop-filter` fallback for iOS Safari) so the page content is effectively masked behind the open drawer. 2. SSOT consistency audit. Coderabbit's PR #107 review surfaced the same class of drift over and over — docs claiming a default, field, enum value, or version number that the SDK code didn't actually use. To prevent that recurring without manual policing: - knowledge/internal/07-docs-consistency.md (new) captures the rules: SSOT priority order (schema → generated types → wrapper SDK → docs page), the eight failure modes we encountered (R1–R8), and a pre-commit checklist that includes the audit script. - scripts/audit-docs.ts (new) parses every /docs/apis and /docs/types page and: - Resolves every internal `<Link to="/docs/...">` against the actual filesystem (R5 — hard failure). - Validates that field-name claims inside `<ul className= "api-params">` lists exist somewhere in the generated `libraries/expo-iap/src/types.ts` interfaces (R3 — advisory warning, since top-level scalar function params legitimately appear in those lists too). - `bun audit:docs` script wired in the root package.json; CLAUDE.md index updated to point at the new doc + script. Caught one real broken `<Link>` already: `/docs/types/ios/subscription-offer-ios` doesn't exist; retargeted to `/docs/types/ios/discount-offer-ios` (DiscountOfferIOS, the actual type covering iOS WinBack / promotional offers). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
packages/docs/src/pages/docs/apis/ios/show-external-purchase-custom-link-notice-ios.tsx (2)
132-147: TypeScript and Dart examples discard the result; other tabs keep it.Swift/Kotlin/GDScript examples capture
result =so readers can see how to inspectcontinued/error. The TypeScript and Dart snippets justawaitthe call, which leaves the most important part (the return shape that the Returns section just documented) unused.♻️ Suggested tweak
typescript: ( <CodeBlock language="typescript">{`// expo-iap (also exported from react-native-iap) import { Platform } from 'react-native'; import { showExternalPurchaseCustomLinkNoticeIOS } from 'expo-iap'; if (Platform.OS === 'ios') { - await showExternalPurchaseCustomLinkNoticeIOS('browser'); + const result = await showExternalPurchaseCustomLinkNoticeIOS('browser'); + if (result.continued) { + // route the user to your external purchase URL + } }`}</CodeBlock> ), dart: ( <CodeBlock language="dart">{`if (Platform.isIOS) { - await FlutterInappPurchase.instance.showExternalPurchaseCustomLinkNoticeIOS( - ExternalPurchaseCustomLinkNoticeTypeIOS.Browser, - ); + final result = await FlutterInappPurchase.instance + .showExternalPurchaseCustomLinkNoticeIOS( + ExternalPurchaseCustomLinkNoticeTypeIOS.Browser, + ); }`}</CodeBlock> ),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/docs/src/pages/docs/apis/ios/show-external-purchase-custom-link-notice-ios.tsx` around lines 132 - 147, Update the TypeScript and Dart examples to capture and surface the function result instead of discarding it: assign the awaited return value from showExternalPurchaseCustomLinkNoticeIOS (TypeScript) and FlutterInappPurchase.instance.showExternalPurchaseCustomLinkNoticeIOS (Dart) to a variable like result so readers can inspect properties such as continued or error consistent with the Swift/Kotlin/GDScript examples and the Returns documentation.
155-159: Per-language casing mapping is ambiguous.The trailing note lists three languages (Swift / Kotlin / Dart) but only two literals (
.browser/.Browser). Readers can't tell which is which. Swift uses.browser(lowercase); Kotlin and Dart use.Browser(PascalCase, matching the examples above). Worth spelling that out explicitly.✏️ Suggested wording
<p> <code>ExternalPurchaseCustomLinkNoticeTypeIOS</code> currently has a - single value: <code>'browser'</code> (case-sensitive — Swift / Kotlin / - Dart spell it as <code>.browser</code> / <code>.Browser</code>). + single value: <code>'browser'</code> (case-sensitive — Swift uses + <code>.browser</code>, Kotlin and Dart use <code>.Browser</code>). </p>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/docs/src/pages/docs/apis/ios/show-external-purchase-custom-link-notice-ios.tsx` around lines 155 - 159, Update the per-language casing note for ExternalPurchaseCustomLinkNoticeTypeIOS to explicitly map each language to its literal: state that Swift uses `.browser` (lowercase), while Kotlin and Dart use `.Browser` (PascalCase); replace the ambiguous "Swift / Kotlin / Dart spell it as `.browser` / `.Browser`" with the clear three-way mapping so readers can unambiguously see which casing applies to Swift, Kotlin, and Dart.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/docs/src/pages/docs/apis/android/launch-external-link-android.tsx`:
- Around line 142-197: Examples use incorrect enum members for
ExternalLinkLaunchModeAndroid and ExternalLinkTypeAndroid; update all language
examples (kotlin, kmp, typescript, dart, gdscript) to use the canonical enum
values. Replace IN_APP_BROWSER / in-app-browser / inAppBrowser / IN_APP_BROWSER
with LaunchInExternalBrowserOrApp (or CallerWillLaunchLink / Unspecified as
appropriate) for ExternalLinkLaunchModeAndroid, and replace OFFER / offer /
.offer / OFFER with LinkToDigitalContentOffer (or LinkToAppDownload /
Unspecified as appropriate) for ExternalLinkTypeAndroid; ensure the
LaunchExternalLinkParamsAndroid construction (LaunchExternalLinkParamsAndroid,
launchExternalLinkAndroid,
FlutterInappPurchase.instance.launchExternalLinkAndroid,
iap.launch_external_link_android) uses the corrected enum identifiers for each
language binding so examples compile/type-check.
In
`@packages/docs/src/pages/docs/apis/ios/can-present-external-purchase-notice-ios.tsx`:
- Around line 22-36: Update the incorrect JSDoc that states "iOS 18.2+" to the
correct "iOS 17.4+" so it matches Apple's docs; locate the JSDoc that documents
ExternalPurchase.canPresent (in the module exporting
presentExternalPurchaseNoticeSheetIOS / ExternalPurchase.canPresent) and change
the iOS version text to "iOS 17.4+".
In `@packages/docs/src/pages/docs/apis/restore-purchases.tsx`:
- Around line 76-84: Update the Returns text for restorePurchases to avoid
implying restored purchases are emitted to the purchaseUpdatedListener by
default; state that restorePurchases resolves when the platform completes
restore and that restored entitlements are returned via getAvailablePurchases
(and that on iOS the wrapper calls getAvailablePurchases with
alsoPublishToEventListenerIOS: false, so listeners are not re-emitted unless
platform/native behavior differs). Reference restorePurchases,
getAvailablePurchases, and purchaseUpdatedListener so readers can locate the
relevant behavior and mention the alsoPublishToEventListenerIOS flag to explain
the iOS-specific behavior.
In `@scripts/audit-docs.ts`:
- Line 494: The script currently calls main() directly which allows rejections
from walkTsxFiles/buildTypeIndex or file I/O to become unhandled; change the
invocation to call main().catch(err => { log the error (including err.stack or
err.message) to console or the existing logger and exit with a non-zero code })
so any promise rejection is logged clearly and the process exits
deterministically.
---
Nitpick comments:
In
`@packages/docs/src/pages/docs/apis/ios/show-external-purchase-custom-link-notice-ios.tsx`:
- Around line 132-147: Update the TypeScript and Dart examples to capture and
surface the function result instead of discarding it: assign the awaited return
value from showExternalPurchaseCustomLinkNoticeIOS (TypeScript) and
FlutterInappPurchase.instance.showExternalPurchaseCustomLinkNoticeIOS (Dart) to
a variable like result so readers can inspect properties such as continued or
error consistent with the Swift/Kotlin/GDScript examples and the Returns
documentation.
- Around line 155-159: Update the per-language casing note for
ExternalPurchaseCustomLinkNoticeTypeIOS to explicitly map each language to its
literal: state that Swift uses `.browser` (lowercase), while Kotlin and Dart use
`.Browser` (PascalCase); replace the ambiguous "Swift / Kotlin / Dart spell it
as `.browser` / `.Browser`" with the clear three-way mapping so readers can
unambiguously see which casing applies to Swift, Kotlin, and Dart.
🪄 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: fa5c069e-ea29-4c9d-9bc6-03c2f9a926c7
📒 Files selected for processing (26)
CLAUDE.mdknowledge/internal/07-docs-consistency.mdlibraries/expo-iap/src/index.tslibraries/react-native-iap/src/index.tspackage.jsonpackages/apple/Sources/OpenIapModule.swiftpackages/docs/src/components/CodeBlock.tsxpackages/docs/src/pages/docs/apis/android/is-billing-program-available-android.tsxpackages/docs/src/pages/docs/apis/android/launch-external-link-android.tsxpackages/docs/src/pages/docs/apis/get-available-purchases.tsxpackages/docs/src/pages/docs/apis/get-storefront.tsxpackages/docs/src/pages/docs/apis/init-connection.tsxpackages/docs/src/pages/docs/apis/ios/begin-refund-request-ios.tsxpackages/docs/src/pages/docs/apis/ios/can-present-external-purchase-notice-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-receipt-data-ios.tsxpackages/docs/src/pages/docs/apis/ios/get-transaction-jws-ios.tsxpackages/docs/src/pages/docs/apis/ios/is-eligible-for-intro-offer-ios.tsxpackages/docs/src/pages/docs/apis/ios/is-transaction-verified-ios.tsxpackages/docs/src/pages/docs/apis/ios/present-code-redemption-sheet-ios.tsxpackages/docs/src/pages/docs/apis/ios/show-external-purchase-custom-link-notice-ios.tsxpackages/docs/src/pages/docs/apis/ios/sync-ios.tsxpackages/docs/src/pages/docs/apis/restore-purchases.tsxpackages/docs/src/pages/docs/types/discount-offer.tsxpackages/docs/src/pages/docs/types/external-purchase-link.tsxpackages/docs/src/styles/documentation.cssscripts/audit-docs.ts
✅ Files skipped from review due to trivial changes (5)
- CLAUDE.md
- package.json
- knowledge/internal/07-docs-consistency.md
- packages/docs/src/pages/docs/apis/init-connection.tsx
- libraries/expo-iap/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (10)
- packages/docs/src/pages/docs/apis/get-storefront.tsx
- packages/docs/src/pages/docs/apis/ios/is-eligible-for-intro-offer-ios.tsx
- packages/docs/src/pages/docs/apis/ios/begin-refund-request-ios.tsx
- packages/docs/src/pages/docs/apis/get-available-purchases.tsx
- packages/docs/src/pages/docs/types/discount-offer.tsx
- packages/docs/src/pages/docs/types/external-purchase-link.tsx
- packages/docs/src/components/CodeBlock.tsx
- packages/docs/src/pages/docs/apis/ios/present-code-redemption-sheet-ios.tsx
- packages/docs/src/styles/documentation.css
- packages/apple/Sources/OpenIapModule.swift
25bfc35 to
5b4f239
Compare
Several rounds of "z-index 9001 should beat the top nav's 100" still
left the docs Menu button un-tappable, the top nav hamburger
overlapping the docs sidebar toggle, and (the final straw) a closed
drawer still absorbing taps on its child links because
`visibility: hidden; opacity: 0` alone doesn't stop iOS Safari from
delivering touches to a fixed subtree.
This squashes the iterative fixes into one coherent change:
- Hide the top nav hamburger on /docs routes so the docs sidebar
toggle is the only "open menu" affordance there.
- Push the toggle below the sticky top nav (top: 70px, scrolled: 64px)
and portal it to document.body so it sits outside any ancestor's
stacking context.
- Unmount the toggle while the drawer is open — leaving it in the DOM
with `.hidden { pointer-events: none }` still let iOS Safari swallow
taps meant for the drawer's "APIs" / open child rows underneath.
- Slide the closed drawer off-screen (translateX(-100%)) and disable
pointer-events on it so child links stop firing while it looks
closed.
- Bump baseline-browser-mapping to ^2.10.22 to silence the
"data is over two months old" warning from browserslist.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5b4f239 to
224b833
Compare
- launch-external-link-android: replace fictional enum members (IN_APP_BROWSER, OFFER, in-app-browser, offer, .inAppBrowser, .offer) with the canonical values from each binding — ExternalLinkLaunchModeAndroid.LaunchInExternalBrowserOrApp / launch-in-external-browser-or-app / LAUNCH_IN_EXTERNAL_BROWSER_OR_APP, and ExternalLinkTypeAndroid .LinkToDigitalContentOffer / link-to-digital-content-offer / LINK_TO_DIGITAL_CONTENT_OFFER — so all 5 example tabs actually compile. - canPresentExternalPurchaseNoticeIOS JSDoc in expo-iap and react-native-iap: was "iOS 18.2+", but ExternalPurchase.canPresent has been available since iOS 17.4. The notice sheet itself remains iOS 18.2+; clarified in the comment so callers don't conflate the two. - scripts/audit-docs.ts: wrap main() in .catch so unhandled rejections from walkTsxFiles / buildTypeIndex / file I/O surface as a clear "audit-docs: fatal error" message and exit code 2, instead of bubbling up as a confusing trace. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The KMP example only showed the constructor approach, missing the
trailing-lambda DSL form that kmp-iap exposes via the
ProductsRequestBuilder extension. Updated the kmp tab to demonstrate
both:
1) Builder (constructor) — pass ProductRequest, get
FetchProductsResult to unwrap by variant.
2) DSL — trailing-lambda builder, returns List<Product> directly.
requestPurchase already shows both Kotlin DSL and Dart
requestPurchaseWithBuilder; fetchProducts has no builder API in
Dart (no fetchProductsWithBuilder exists), so KMP is the only tab
that needed updating. The TypeScript tab already includes both
root-API and useIAP hook examples.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR is a docs-focused cross-linking and consistency pass across OpenIAP’s GraphQL schema descriptions, docs site API/type pages, and wrapper SDK JSDoc/KDoc-style comments, plus some responsive UI fixes for the docs site navigation and code blocks.
Changes:
- Added canonical openiap.dev links and richer descriptions to GraphQL schema docstrings (core + Android-specific APIs).
- Updated docs-site pages with platform behavior blurbs, parameters/returns/throws sections, and improved responsive layout (sidebar drawer, overlays, code-block header/tab bar).
- Added/expanded wrapper hook/API doc comments to link to the corresponding openiap.dev reference pages; introduced a docs consistency guide + audit script wiring.
Reviewed changes
Copilot reviewed 104 out of 110 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/gql/src/api.graphql | Adds canonical doc URLs + clarified API descriptions for core GraphQL operations. |
| packages/gql/src/api-android.graphql | Adds canonical doc URLs + clarified Android mutation docs (alt billing + billing programs). |
| packages/docs/src/styles/responsive.css | Removes conflicting mobile sidebar rules (defers to documentation.css mobile drawer rules). |
| packages/docs/src/styles/documentation.css | Fixes sidebar/table mobile behavior; improves overlay/toggle z-index and drawer hit-testing. |
| packages/docs/src/styles/code.css | Reworks code-block header into an attached “tab bar”; styles linkified type refs. |
| packages/docs/src/pages/docs/** | Adds platform behavior blurbs and stronger reference structure across many API/type pages. |
| packages/docs/src/pages/docs/index.tsx | Portals docs sidebar toggle to document.body and unmounts it while open to avoid tap conflicts. |
| packages/docs/src/components/Navigation.tsx | Hides the top-nav mobile hamburger/dropdown on /docs routes to avoid overlap with docs sidebar toggle. |
| packages/docs/src/components/CodeBlock.tsx | Adds type-name linkification in highlighted code snippets via a TYPE_LINKS map. |
| packages/docs/package.json | Adds baseline-browser-mapping dependency. |
| package.json | Adds audit:docs script entrypoint. |
| libraries/react-native-iap/src/hooks/useIAP.ts | Adds/expands JSDoc blocks linking to openiap.dev references for hook APIs. |
| libraries/expo-iap/src/useIAP.ts | Adds/expands JSDoc blocks linking to openiap.dev references for hook APIs. |
| libraries/expo-iap/src/modules/android.ts | Adds @see links for Android module-level APIs. |
| knowledge/internal/07-docs-consistency.md | New SSOT consistency rules doc + audit workflow guidance. |
| bun.lock | Locks dependency updates for docs package additions. |
| CLAUDE.md | Links the new docs consistency guide and references running bun audit:docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- fetchProducts JSDoc (`@throws`) in expo-iap and react-native-iap (root + useIAP hook): the underlying StoreKit/Play call returns an empty array for unknown SKUs, so "unknown SKU" was misleading. Reworded to "empty `skus`, not connected, network/store error" and added a clarifying note that unknown SKUs are silently omitted. - fetch-products docs page iOS blurb: same correction — `Product.products(for:)` does not validate SKUs; only transport failures throw. - present-external-purchase-link-ios: the openiap-apple implementation calls `UIApplication.open` after a `canOpenURL` guard, not StoreKit's `ExternalPurchaseLink.open(url:)`. Updated the description and the reference link to match what the code actually does, while keeping the "production builds still need the StoreKit external-purchase entitlement" caveat. - Navigation.tsx: stop hiding the top-nav hamburger and dropdown on /docs routes — that stranded Introduction / Languages / Tutorials / Sponsors behind only the logo link on mobile. The earlier tap-conflict between this menu and the docs sidebar toggle was fixed at the source (closed docs sidebar uses `pointer-events: none` + `translateX(-100%)`); the two affordances also don't overlap geometrically (top-right vs. left-below-nav). Auto-close the dropdown on every route change for safety. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Test plan
swift build— packages/apple./gradlew :openiap:compilePlayDebugKotlin— packages/google./gradlew :library:compileKotlinMetadata— kmp-iapbun run lint:tsc— expo-iapyarn typecheck— react-native-iap (pre-existing example-expo errors unrelated)dart analyze lib— flutter_inapp_purchasebun run build— packages/docs (vite + tsc)🤖 Generated with Claude Code
Summary by CodeRabbit