-
Notifications
You must be signed in to change notification settings - Fork 82
Expose Virtual Currency Constructors with @InternalRevenueCatAPI #2543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
@RCGitBot please test |
MarkVillacampa
approved these changes
Jul 17, 2025
tonidero
approved these changes
Jul 17, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2543 +/- ##
=======================================
Coverage 78.26% 78.26%
=======================================
Files 291 291
Lines 10782 10782
Branches 1507 1507
=======================================
Hits 8439 8439
Misses 1691 1691
Partials 652 652 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jul 17, 2025
**This is an automatic release.** ### 🔄 Other Changes * [AUTOMATIC][Paywalls V2] Updates paywall-preview-resources submodule (#2544) via RevenueCat Git Bot (@RCGitBot) * Expose Virtual Currency Constructors with @InternalRevenueCatAPI (#2543) via Will Taylor (@fire-at-will) * Expose API key validation result to BillingFactory (#2542) via Toni Rico (@tonidero) Co-authored-by: revenuecat-ops <ops@revenuecat.com>
tonidero
pushed a commit
that referenced
this pull request
Aug 25, 2025
### Description This PR exposes the `VirtualCurrency` and `VirtualCurrencies` constructors publicly behind the `@InternalRevenueCatAPI` annotation. This will help us in a few scenarios when we need to instantiate VC objects outside of `purchases-android`, including in the mapper tests in PHC. #### Other Approaches Considered We considered a few other approaches before deciding to use `@InternalRevenueCatAPI`: - Making the constructor public without an annotation. This works, but isn't ideal for a few reasons: - Adding new properties would be a breaking change unless we used the `@JvmOverloads` annotation. Even then, we would need to provide a default value, and that won't always be easy (e.g. when we add VC icons, these will likely not be optionals) - Parsing the VC objects from JSON in the PHC mapper tests. This would work but feels a little dirty, and wouldn't help us if we ever need to do this in other circumstances. Using `@InternalRevenueCatAPI` allows us to access the constructor outside of `purchases-android` while still giving us the freedom to make breaking changes to the constructor in the future.
Closed
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.
Description
This PR exposes the
VirtualCurrency
andVirtualCurrencies
constructors publicly behind the@InternalRevenueCatAPI
annotation. This will help us in a few scenarios when we need to instantiate VC objects outside ofpurchases-android
, including in the mapper tests in PHC.Other Approaches Considered
We considered a few other approaches before deciding to use
@InternalRevenueCatAPI
:@JvmOverloads
annotation. Even then, we would need to provide a default value, and that won't always be easy (e.g. when we add VC icons, these will likely not be optionals)Using
@InternalRevenueCatAPI
allows us to access the constructor outside ofpurchases-android
while still giving us the freedom to make breaking changes to the constructor in the future.