Skip to content

Unified StoreReplacementMode API#1746

Merged
fire-at-will merged 13 commits into
mainfrom
unified-store-replacement-mode-api
May 8, 2026
Merged

Unified StoreReplacementMode API#1746
fire-at-will merged 13 commits into
mainfrom
unified-store-replacement-mode-api

Conversation

@fire-at-will

@fire-at-will fire-at-will commented May 6, 2026

Copy link
Copy Markdown
Contributor

Introduces the new unified StoreReplacementMode APIs to the React Native SDK.

API Changes

  • Deprecates GoogleProductChangeInfo and GoogleProrationMode types
  • Introduces StoreProductChangeInfo and StoreReplacementMode types
  • Introduces StoreProductChangeInfo? productChangeInfo as a param for the PurchaseParam builder functions.

Testing

  • Updated API testers
  • New unit tests
  • Manually tested:
GoogleProductChangeInfo (Legacy) StoreProductChangeInfo (New) No productChangeInfo param
PurchaseParams.package()
PurchaseParams.storeProduct()
PurchaseParams.subscriptionOption()
purchasePackage() N/A
purchaseProduct() N/A
purchaseSubscriptionOption() N/A

Purchase Tester Updates

Adds a new screen to the purchase tester app that allows you to test product changes.


Note

Medium Risk
Changes the purchase argument contract across Dart↔Android bridging by replacing googleProrationMode with storeReplacementMode, which could affect upgrade/downgrade behavior if mappings or native expectations differ. Most changes are additive/deprecations with updated tests, but they touch purchase flow paths.

Overview
Introduces a unified, store-agnostic product-change API by adding StoreProductChangeInfo + StoreReplacementMode and wiring it into PurchaseParams builders (while deprecating GoogleProductChangeInfo/GoogleProrationMode).

Updates purchase calls to send storeReplacementMode (string) through the Flutter method channel and Android plugin, including mapping legacy Google proration ints to the new enum, and ensures PurchaseParams.productChangeInfo takes precedence over legacy fields. Adds API tester coverage, a new purchase-tester screen for manual product-change testing, and updates/extends unit tests for the new arguments and types.

Reviewed by Cursor Bugbot for commit f6d89a4. Bugbot is set up for automated code reviews on this repo. Configure here.

@fire-at-will fire-at-will added the pr:feat A new feature label May 6, 2026
@fire-at-will fire-at-will marked this pull request as ready for review May 7, 2026 17:36
@fire-at-will fire-at-will requested a review from a team as a code owner May 7, 2026 17:36
@fire-at-will fire-at-will requested a review from tonidero May 7, 2026 17:36

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7a05c4d. Configure here.

Comment thread lib/purchases_flutter.dart Outdated

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this looks good!

Comment thread lib/purchases_flutter.dart Outdated
@fire-at-will

Copy link
Copy Markdown
Contributor Author

@tonidero One thing I noticed here. If you use the double-deprecated UpgradeInfo APIs with the other deprecated ProrationMode, and set the proration mode to the old ProrationMode.unknownSubscriptionUpgradeDowngradePolicy value, we default to the native SDK's default proration mode - StoreReplacementMode.WITHOUT_PRORATION.

This sounds like a pretty good way to go to me, do you see any issues with that?

@tonidero

tonidero commented May 8, 2026

Copy link
Copy Markdown
Contributor

That makes sense to me indeed 👍 Thanks for checking!

@fire-at-will fire-at-will merged commit 5fb0ac1 into main May 8, 2026
17 checks passed
@fire-at-will fire-at-will deleted the unified-store-replacement-mode-api branch May 8, 2026 15:29
This was referenced May 13, 2026
RCGitBot added a commit that referenced this pull request May 13, 2026
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Unified StoreReplacementMode API (#1746) via Will Taylor
(@fire-at-will)
### 📦 Dependency Updates
* [RENOVATE] Update dependency gradle to v8.14.5 (#1749) via RevenueCat
Git Bot (@RCGitBot)
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 18.6.0 (#1748) via
RevenueCat Git Bot (@RCGitBot)
* [Android
10.5.0](https://github.com/RevenueCat/purchases-android/releases/tag/10.5.0)
* [Android
10.4.0](https://github.com/RevenueCat/purchases-android/releases/tag/10.4.0)
* [iOS
5.72.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.72.0)
* [iOS
5.71.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.71.0)
* [Web
1.39.0](https://github.com/RevenueCat/purchases-js/releases/tag/1.39.0)
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 18.5.0 (#1747) via
RevenueCat Git Bot (@RCGitBot)

### 🔄 Other Changes
* Bump fastlane from 2.233.1 to 2.234.0 (#1751) via dependabot[bot]
(@dependabot[bot])

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Primarily a release/version bump across Flutter, Android, iOS/macOS,
and web metadata with no functional code changes beyond updated version
strings and documented dependency updates.
> 
> **Overview**
> Publishes release `10.1.0` by bumping version numbers across
`pubspec.yaml`, Android/iOS/macOS build specs, and web/native plugin
version constants.
> 
> Updates release documentation (`CHANGELOG.md`, `CHANGELOG-LATEST.md`,
`VERSIONS.md`, `.version`) to include the `Unified StoreReplacementMode`
feature and refreshed dependency versions, and aligns
`purchases_ui_flutter` to depend on `purchases_flutter ^10.1.0`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
184b573. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants