Add number and boolean custom variable types#1683
Merged
Merged
Conversation
Extends CustomVariableValue sealed class with .number(double) and .boolean(bool) constructors. Updates platform code (iOS/Android) to preserve types through the method channel instead of converting everything to strings. Depends on: RevenueCat/purchases-hybrid-common#1557 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Updates PHC dependency across all platforms to pick up number and boolean custom variable type support in the bridge layer. Also aligns iOS PaywallView type checking order with PHC (Bool before NSNumber). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
setCustomVariableNumber and setCustomVariableBool are internal to RevenueCatUI, so calling them directly from the Flutter plugin would fail to compile. Instead, set customVariables on PaywallViewCreationParams and let PHC's createPaywallView handle the type dispatch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
Ensures the API tester will fail to compile if a new subtype is added to the sealed CustomVariableValue hierarchy without updating the test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sealed would be a source-breaking change for downstream code that exhaustively switches on CustomVariableValue. abstract final prevents external subclassing without requiring exhaustive pattern matching, making it safe to add new subtypes in future releases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
vegaro
approved these changes
Mar 18, 2026
vegaro
left a comment
Member
There was a problem hiding this comment.
some comments that are not very critical but would like you to take a look before merging
- Remove unnecessary Int/Long/Float cases in PaywallView.kt (Dart always sends doubles) - Restore null filtering for customVariables on iOS before passing to PHC params - Remove nativeValue from public API; move type-preserving conversion to internal function Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
Addressed all three review comments in 5601764:
|
facumenzella
added a commit
to RevenueCat/react-native-purchases
that referenced
this pull request
Mar 18, 2026
## Summary - Extends `CustomVariableValue` with `number` and `boolean` types (previously string-only) - Passes typed values over the RN bridge instead of converting to strings, letting native SDKs use them for conditional paywall logic - Updates Android bridge (`BasePaywallViewManager`, `RNPaywallsModule`) to read typed values via `ReadableType` dispatch - Updates iOS bridge (`PaywallViewWrapper`) to call `setCustomVariableNumber:forKey:` and `setCustomVariableBool:forKey:` - iOS `RNPaywalls.m` (presentPaywall path) needs no changes — PHC's `PaywallProxy` already handles typed values from the dictionary Mirrors the Flutter implementation: RevenueCat/purchases-flutter#1683 ## Test plan - [x] Unit tests pass (18 tests covering all types, mixed types, edge cases) - [x] API tester type-checks pass (`npm run apitest`) - [ ] Manual test on iOS with number/boolean custom variables in a V2 paywall - [ ] Manual test on Android with number/boolean custom variables in a V2 paywall 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
facumenzella
pushed a commit
that referenced
this pull request
Mar 18, 2026
**This is an automatic release.** ## RevenueCat SDK ### ✨ New Features * Add trackCustomPaywallImpression API (#1679) via Rick (@rickvdl) * Adds Galaxy to the Store Enum (#1677) via Will Taylor (@fire-at-will) ### 📦 Dependency Updates * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.52.0 (#1689) via RevenueCat Git Bot (@RCGitBot) * [Android 9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1) * [Android 9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0) * [Android 9.25.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.25.0) * [Android 9.24.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.24.0) * [iOS 5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0) * [iOS 5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0) * [iOS 5.63.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.63.0) * [iOS 5.62.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.62.0) * Updates purchases-hybrid-common to 17.51.1 (#1687) via RevenueCat Git Bot (@RCGitBot) * [Android 9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1) * [Android 9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0) * [Android 9.25.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.25.0) * [Android 9.24.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.24.0) * [iOS 5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0) * [iOS 5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0) * [iOS 5.63.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.63.0) * [iOS 5.62.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.62.0) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.51.0 (#1685) via RevenueCat Git Bot (@RCGitBot) * [Android 9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1) * [Android 9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0) * [Android 9.25.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.25.0) * [Android 9.24.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.24.0) * [iOS 5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0) * [iOS 5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0) * [iOS 5.63.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.63.0) * [iOS 5.62.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.62.0) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.50.0 (#1682) via RevenueCat Git Bot (@RCGitBot) * [Android 9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1) * [Android 9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0) * [Android 9.25.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.25.0) * [Android 9.24.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.24.0) * [iOS 5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0) * [iOS 5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0) * [iOS 5.63.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.63.0) * [iOS 5.62.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.62.0) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.49.0 (#1680) via RevenueCat Git Bot (@RCGitBot) * [Android 9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1) * [Android 9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0) * [Android 9.25.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.25.0) * [Android 9.24.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.24.0) * [iOS 5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0) * [iOS 5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0) * [iOS 5.63.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.63.0) * [iOS 5.62.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.62.0) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.48.0 (#1678) via RevenueCat Git Bot (@RCGitBot) * [Android 9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1) * [Android 9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0) * [Android 9.25.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.25.0) * [Android 9.24.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.24.0) * [iOS 5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0) * [iOS 5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0) * [iOS 5.63.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.63.0) * [iOS 5.62.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.62.0) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.47.0 (#1676) via RevenueCat Git Bot (@RCGitBot) * [Android 9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1) * [Android 9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0) * [Android 9.25.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.25.0) * [Android 9.24.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.24.0) * [iOS 5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0) * [iOS 5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0) * [iOS 5.63.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.63.0) * [iOS 5.62.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.62.0) ## RevenueCatUI SDK ### ✨ New Features * Add number and boolean custom variable types (#1683) via Facundo Menzella (@facumenzella) ### 🔄 Other Changes * Bump fastlane-plugin-revenuecat_internal from `3e8c384` to `9a6911b` (#1688) via dependabot[bot] (@dependabot[bot]) * Bump fastlane-plugin-revenuecat_internal from `e146447` to `3e8c384` (#1681) via dependabot[bot] (@dependabot[bot])
facumenzella
added a commit
to RevenueCat/purchases-unity
that referenced
this pull request
Mar 18, 2026
## Summary - Extends `CustomVariableValue` with `Number(double)` and `Boolean(bool)` factory methods - Preserves native types (number, boolean) through JSON serialization instead of converting everything to strings - Updates Android `PaywallViewPresenter` to parse typed JSON values into `CustomVariableValue.Number` and `.Boolean` - Uncomments Number/Boolean support in `PaywallsBehaviour` enum and Editor drawer - Updates API tests for new types Unity equivalent of RevenueCat/purchases-flutter#1683 ## Test plan - [ ] Verify string custom variables still work on device - [ ] Test number custom variables render correctly in paywalls - [ ] Test boolean custom variables render correctly in paywalls - [ ] API tests compile 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CustomVariableValuesealed class with.number(double)and.boolean(bool)constructorsPaywallView.kt,PurchasesUiFlutterPlugin.kt) to map typed values toCustomVariableValue.Numberand.BooleanPurchasesUiPaywallView.swift,PurchasesUiFlutterPlugin.swift) to callsetCustomVariableNumberandsetCustomVariableBoolDependencies
Test plan
dart format .is cleanflutter analyze libpassesflutter testpasses (25/25)🤖 Generated with Claude Code