Skip to content

feat: sync with openiap v1.3.15#610

Merged
hyochan merged 3 commits intomainfrom
feat/openiap-sync-1.3.15
Jan 20, 2026
Merged

feat: sync with openiap v1.3.15#610
hyochan merged 3 commits intomainfrom
feat/openiap-sync-1.3.15

Conversation

@hyochan
Copy link
Copy Markdown
Owner

@hyochan hyochan commented Jan 20, 2026

Summary

  • Sync with OpenIAP v1.3.15 (gql: 1.3.15, google: 1.3.26, apple: 1.3.13)
  • Simplified input field names for Android request props (per OpenIAP naming convention)
  • Added offerToken support for one-time purchase discounts (Android 7.0+)

Changes

Field Name Simplification

Input fields in Android-specific request props now use simplified names (without redundant Android suffix):

Old Name New Name
obfuscatedAccountIdAndroid obfuscatedAccountId
obfuscatedProfileIdAndroid obfuscatedProfileId
purchaseTokenAndroid purchaseToken
replacementModeAndroid replacementMode

New Feature: One-Time Purchase Discounts

Added offerToken field to RequestPurchaseAndroidProps for applying discounts to one-time (non-subscription) purchases (Android 7.0+).

Files Changed

  • openiap-versions.json - Updated version tracking
  • lib/types.dart - Regenerated with new field names
  • lib/flutter_inapp_purchase.dart - Updated to pass new field names to native
  • lib/builders.dart - Updated builder classes with new field names
  • android/.../AndroidInappPurchasePlugin.kt - Updated native code to handle new fields
  • test/builders_unit_test.dart - Updated tests
  • test/flutter_inapp_purchase_channel_test.dart - Updated tests
  • docs/blog/2026-01-20-8.2.3.release.md - Added release blog post

Test Plan

  • flutter analyze passes
  • flutter test passes (198 tests)
  • Blog post created

OpenIAP Versions

Package Previous Current
openiap-gql 1.3.14 1.3.15
openiap-google 1.3.25 1.3.26
openiap-apple 1.3.12 1.3.13

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for one-time purchase discounts on Android 7.0+ using offer tokens
  • Breaking Changes

    • Simplified Android field names by removing "Android" suffixes across purchase and subscription configurations; migration guide included in documentation
  • Dependencies

    • Updated underlying billing library versions for improved Google Play integration
  • Documentation

    • Added comprehensive release notes with field migration examples and builder usage updates

✏️ Tip: You can customize this high-level summary in your review settings.

- Update openiap-versions.json (gql: 1.3.15, google: 1.3.26, apple: 1.3.13)
- Regenerate Dart types with simplified input field names
- Update Android native code to pass offerToken for one-time purchase discounts
- Update Dart API layer to use new field names (obfuscatedAccountId, obfuscatedProfileId, purchaseToken, replacementMode)
- Update builders to use simplified field names and add offerToken support
- Update tests to use new field names
- Add release blog post

Field name changes (input fields, Android only):
- obfuscatedAccountIdAndroid → obfuscatedAccountId
- obfuscatedProfileIdAndroid → obfuscatedProfileId
- purchaseTokenAndroid → purchaseToken
- replacementModeAndroid → replacementMode
- Added: offerToken (for one-time purchase discounts, Android 7.0+)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 20, 2026

Warning

Rate limit exceeded

@hyochan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between f445a58 and 867918b.

📒 Files selected for processing (3)
  • android/src/main/kotlin/io/github/hyochan/flutter_inapp_purchase/AndroidInappPurchasePlugin.kt
  • docs/static/llms-full.txt
  • example/lib/src/screens/builder_demo_screen.dart
📝 Walkthrough

Walkthrough

Renames Android-specific field suffixes to simplified generic names (purchaseTokenAndroid → purchaseToken, obfuscatedAccountIdAndroid → obfuscatedAccountId, etc.) and adds offerToken support for one-time purchase discounts on Android 7.0+ across native plugins, type definitions, builders, and related tests while maintaining backward compatibility.

Changes

Cohort / File(s) Summary
Android Native Plugin
android/src/main/kotlin/io/github/hyochan/flutter_inapp_purchase/AndroidInappPurchasePlugin.kt
Renames input/output field keys and parameter names (purchaseTokenAndroid → purchaseToken, replacementModeAndroid → replacementMode, obfuscatedAccountIdAndroid → obfuscatedAccountId, obfuscatedProfileIdAndroid → obfuscatedProfileId). Updates input parsing to accept both legacy Android-suffixed and new simplified keys. Adds offerToken support in buildRequestPurchaseProps and wires it to OpenIAP props for InApp purchases. Updates internal constants.
Public Type Definitions
lib/types.dart
Updates RequestPurchaseAndroidProps and RequestSubscriptionAndroidProps field declarations from Android-suffixed to simplified names. Adds new optional offerToken field to RequestPurchaseAndroidProps. Updates JSON serialization (fromJson/toJson) to read/write new field names and offerToken.
Purchase Flow Builders
lib/builders.dart
Updates RequestPurchaseAndroidBuilder and RequestSubscriptionAndroidBuilder with renamed fields and adds new offerToken field to RequestPurchaseAndroidBuilder. Updates build() mappings to propagate renamed fields and offerToken into RequestPurchaseAndroidProps and RequestSubscriptionAndroidProps.
Flutter Channel Implementation
lib/flutter_inapp_purchase.dart
Updates purchase payload construction to use simplified field names instead of Android-suffixed variants. Adds conditional payload entry for offerToken (Android 7.0+). Ensures offerToken is null for subscription paths.
Dependency Management
openiap-versions.json
Updates OpenIAP package versions: google 1.3.25 → 1.3.26, gql 1.3.14 → 1.3.15.
Documentation
docs/blog/2026-01-20-8.2.3.release.md
Release notes for v8.2.3 documenting one-time purchase discounts via offerToken, migration guide for simplified field naming, updated builder examples, field change tables, and updated dependency references.
Unit Tests
test/builders_unit_test.dart, test/flutter_inapp_purchase_channel_test.dart
Updates test expectations and assertions to reference renamed fields in RequestPurchaseAndroidBuilder and RequestSubscriptionAndroidBuilder. Adds offerToken test coverage for purchase builder. Updates payload assertions to reflect new field names.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #603: Both PRs modify AndroidInappPurchasePlugin.kt's buildRequestPurchaseProps to extend Android purchase payload fields (offerToken addition and field renaming)
  • #555: Both PRs modify AndroidInappPurchasePlugin.kt and the Android purchase request flow with offerToken and purchase payload field changes

Suggested labels

$ openiap, 🎯 feature, 🤖 android, :package: update packages, 🚚 migration

Poem

🐰 Fields simplified, no more suffixes to name,
offerToken hops in to join the game,
From Android-specific to generic so clean,
The best purchase flow we've ever seen!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective of syncing with OpenIAP v1.3.15, which is the primary purpose of this changeset including version updates, field renaming, and new offerToken support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.17%. Comparing base (a17c28e) to head (867918b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/flutter_inapp_purchase.dart 40.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #610      +/-   ##
==========================================
- Coverage   67.28%   67.17%   -0.12%     
==========================================
  Files           7        7              
  Lines        1446     1447       +1     
==========================================
- Hits          973      972       -1     
- Misses        473      475       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Fix example code: use `purchaseToken` and `replacementMode` instead of
  `purchaseTokenAndroid` and `replacementModeAndroid` in
  RequestSubscriptionAndroidBuilder
- Update llms-full.txt: use RequestSubscriptionBuilder with correct field
  names for subscription upgrade example

The builder classes use shorter field names without Android suffix,
while the Props types use the full names with Android suffix.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
android/src/main/kotlin/io/github/hyochan/flutter_inapp_purchase/AndroidInappPurchasePlugin.kt (1)

932-941: Fix named-argument mismatch in function call.
Lines 939-940 use purchaseTokenAndroid and replacementModeAndroid, which do not exist as parameters in buildRequestPurchaseProps. The function signature defines purchaseToken and replacementMode. This will cause a Kotlin compilation error.

Fix
                         val requestProps = buildRequestPurchaseProps(
                             type = purchaseType,
                             skus = skus,
                             obfuscatedAccountId = obfuscatedAccountId,
                             obfuscatedProfileId = obfuscatedProfileId,
                             isOfferPersonalized = isOfferPersonalized,
                             subscriptionOffers = emptyList(),
-                            purchaseTokenAndroid = null,
-                            replacementModeAndroid = null
+                            purchaseToken = null,
+                            replacementMode = null
                         )

- Fix purchaseTokenAndroid -> purchaseToken parameter name
- Fix replacementModeAndroid -> replacementMode parameter name
- Add null check for verifyPurchaseWithProvider props

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@hyochan hyochan merged commit ea2cb78 into main Jan 20, 2026
6 checks passed
@hyochan hyochan deleted the feat/openiap-sync-1.3.15 branch January 20, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant