Skip to content

Add number and boolean custom variable types#865

Merged
facumenzella merged 7 commits into
mainfrom
add-number-boolean-custom-variable-types
Mar 18, 2026
Merged

Add number and boolean custom variable types#865
facumenzella merged 7 commits into
mainfrom
add-number-boolean-custom-variable-types

Conversation

@facumenzella

Copy link
Copy Markdown
Member

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

Extends CustomVariableValue with Number(double) and Boolean(bool) factory
methods, preserving native types through JSON serialization to the native
SDKs instead of converting everything to strings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@facumenzella facumenzella requested a review from a team as a code owner March 16, 2026 13:39
facumenzella and others added 3 commits March 16, 2026 15:34
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use primitive boolean and Number.doubleValue() to match Kotlin parameter types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reject NaN, Infinity, and -Infinity at creation time since they produce
invalid JSON and would cause both native bridges to silently drop
custom variables.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread RevenueCatUI/Editor/CustomVariableEntryDrawer.cs Outdated
@facumenzella facumenzella enabled auto-merge (squash) March 18, 2026 17:11
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@facumenzella facumenzella merged commit 1e13aaa into main Mar 18, 2026
8 checks passed
@facumenzella facumenzella deleted the add-number-boolean-custom-variable-types branch March 18, 2026 17:36
facumenzella pushed a commit that referenced this pull request Mar 19, 2026
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Add offeringId override to trackCustomPaywallImpression (#869) via
Rick (@rickvdl)
### 📦 Dependency Updates
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.52.0 (#870) via
RevenueCat Git Bot (@RCGitBot)

## RevenueCatUI SDK
### ✨ New Features
* Add number and boolean custom variable types (#865) via Facundo
Menzella (@facumenzella)

### 🔄 Other Changes
* Bump fastlane-plugin-revenuecat_internal from `3e8c384` to `9a6911b`
(#868) via dependabot[bot] (@dependabot[bot])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants