feat: sync with openiap v1.3.14 (billing library 8.0+ features)#3127
Conversation
- Update openiap-versions.json (gql: 1.3.14, apple: 1.3.12, google: 1.3.25) - Regenerate TypeScript types from OpenIAP - Add productStatusAndroid to NitroProduct (8.0+) - Add includeSuspended option to getAvailablePurchases (8.1+) - Add new iOS types: PromotionalOfferJwsInputIOS, WinBackOfferInputIOS - Add RequestSubscriptionIosProps fields: introductoryOfferEligibility, promotionalOfferJWS, winBackOffer - Add SubResponseCodeAndroid for granular error info (8.0+) - Add BillingResultAndroid with subResponseCode - Add 'win-back' to SubscriptionOfferTypeIOS - Update llms.txt with new API docs - Add release blog post for v14.8.0 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds Android product status and suspended-subscription handling plus iOS subscription offer fields; updates type definitions, Nitro specs, Android/iOS bridge mappings, docs, and OpenIAP dependency versions. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Summary of ChangesHello @hyochan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates the latest OpenIAP v1.3.14, significantly enhancing in-app purchase capabilities for both Android and iOS platforms. It introduces advanced features from Google Play Billing Library 8.0+ for Android, providing more detailed product status information and better handling of suspended subscriptions. For iOS, it incorporates new WWDC 2025 enhancements, enabling new types of promotional and win-back offers, and allowing developers to override introductory offer eligibility. These updates aim to provide developers with more control and insight into their in-app purchase flows. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3127 +/- ##
==========================================
+ Coverage 65.68% 65.70% +0.02%
==========================================
Files 9 9
Lines 1705 1706 +1
Branches 570 571 +1
==========================================
+ Hits 1120 1121 +1
Misses 580 580
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request is a significant update, syncing with OpenIAP v1.3.14 to incorporate new features from Google Play Billing Library 8.0+ and iOS enhancements. The changes are extensive, touching native Android and iOS code, TypeScript types, and documentation. My review focuses on ensuring the new features are correctly implemented. I've identified a potential issue in the Android implementation where an option might be ignored in a specific case. Overall, this is a great step forward in functionality.
| val result: List<OpenIapPurchase> = if (normalizedType != null) { | ||
| val typeEnum = parseProductQueryType(normalizedType) | ||
| RnIapLog.payload( | ||
| "getAvailablePurchases.native", | ||
| mapOf("type" to typeEnum.rawValue) | ||
| mapOf("type" to typeEnum.rawValue, "includeSuspended" to includeSuspended) | ||
| ) | ||
| openIap.getAvailableItems(typeEnum) | ||
| } else { | ||
| RnIapLog.payload("getAvailablePurchases.native", mapOf("type" to "all")) | ||
| openIap.getAvailablePurchases(null) | ||
| RnIapLog.payload("getAvailablePurchases.native", mapOf("type" to "all", "includeSuspended" to includeSuspended)) | ||
| openIap.getAvailablePurchases(purchaseOptions) | ||
| } |
There was a problem hiding this comment.
The includeSuspended option will be ignored when a type is specified (e.g., 'subs' or 'inapp') because openIap.getAvailableItems(typeEnum) is called, which doesn't seem to accept the purchaseOptions that contain the includeSuspended flag. This will lead to inconsistent behavior where suspended purchases are only included when fetching all purchase types.
To fix this, you should use openIap.getAvailablePurchases(purchaseOptions) in both branches of the conditional and then filter the results by type if a type is provided. This ensures the includeSuspended option is always respected.
val allPurchases = openIap.getAvailablePurchases(purchaseOptions)
val result: List<OpenIapPurchase> = if (normalizedType != null) {
val typeEnum = parseProductQueryType(normalizedType)
RnIapLog.payload(
"getAvailablePurchases.native",
mapOf("type" to typeEnum.rawValue, "includeSuspended" to includeSuspended)
)
// Filter the purchases by type, as getAvailablePurchases fetches all types.
allPurchases.filter { it.type.rawValue == normalizedType }
} else {
RnIapLog.payload("getAvailablePurchases.native", mapOf("type" to "all", "includeSuspended" to includeSuspended))
allPurchases
}There was a problem hiding this comment.
Fixed in f986692.
Changes:
- Now always uses
openIap.getAvailablePurchases(purchaseOptions)to ensureincludeSuspendedis respected - Filters results by type after fetching when a type is specified
Thanks for catching this!
There was a problem hiding this comment.
Update: Reverted in 2984378.
After investigation, the suggested fix doesn't work due to OpenIAP API limitations:
getAvailableItems(type)doesn't acceptPurchaseOptionsparameterPurchaseobjects don't have atypeproperty for filtering
The includeSuspended option can only work when fetching all purchase types (without type filter). This is a limitation of the upstream OpenIAP library that would need to be addressed there.
Added a comment in the code to clarify this limitation.
- Fix getAvailablePurchases to always use purchaseOptions with includeSuspended, then filter by type instead of using getAvailableItems which ignores the option - Update docs to remove non-existent connectionError from useIAP examples and use correct API (connected state + onPurchaseError) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
OpenIAP's getAvailableItems doesn't accept PurchaseOptions parameter, and Purchase objects don't have a type property for filtering. The includeSuspended option only works when fetching all purchase types. Added comment to clarify this API limitation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Syncs with OpenIAP v1.3.14 bringing Google Play Billing Library 8.0+ features and iOS WWDC 2025 enhancements.
Android (Billing Library 8.0+)
productStatusAndroidfield to products - explains why a product couldn't be fetched (ok,not-found,no-offers-available)includeSuspendedoption togetAvailablePurchases- include suspended subscriptions (8.1+)isSuspendedAndroidfield to purchasesSubResponseCodeAndroidfor granular error informationiOS (WWDC 2025)
introductoryOfferEligibility- override system-determined eligibility (iOS 15+, back-deployed)promotionalOfferJWS- new JWS format for promotional offers (iOS 15+, back-deployed)winBackOffer- win-back offers for churned subscribers (iOS 18+)'win-back'toSubscriptionOfferTypeIOSChanges
openiap-versions.json(gql: 1.3.14, apple: 1.3.12, google: 1.3.25)HybridRnIap.kt)HybridRnIap.swift)RnIap.nitro.ts)productStatusAndroidllms.txtwith new API documentationTest plan
productStatusAndroidfieldgetAvailablePurchases({ android: { includeSuspended: true }})workswinBackOfferworks (iOS 18+)promotionalOfferJWSworks (iOS 15+)yarn typecheck- passesyarn test- passes🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.