Skip to content

Add hasPaywall property to Offering#2212

Merged
ajpallares merged 6 commits into
mainfrom
offering-has-paywall-property
Mar 4, 2025
Merged

Add hasPaywall property to Offering#2212
ajpallares merged 6 commits into
mainfrom
offering-has-paywall-property

Conversation

@ajpallares

@ajpallares ajpallares commented Mar 4, 2025

Copy link
Copy Markdown
Member

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-ios and hybrids

Motivation

Checking whether an Offering has a paywall is not possible now that there's also v2 paywalls. Added the same property in iOS (see RevenueCat/purchases-ios/pull/4847)

Description

This PR adds the hasPaywall property to Offering to allow knowing whether an Offering has a paywall or not.

@ajpallares ajpallares added the pr:feat A new feature label Mar 4, 2025
@ajpallares ajpallares requested a review from a team March 4, 2025 12:12

@JayShortway JayShortway left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A very welcome addition! Just a suggestion to improve the Java name.

* Whether the offering contains a paywall.
*/
@OptIn(InternalRevenueCatAPI::class)
val hasPaywall: Boolean

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't appy this because you'll need an import, but:

Suggested change
val hasPaywall: Boolean
@JvmName("hasPaywall")
val hasPaywall: Boolean

This should avoid the automatic "get" prefix on the Java side, which I think is unnatural in this case.

(docs for reference)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion!

@emerge-tools

emerge-tools Bot commented Mar 4, 2025

Copy link
Copy Markdown

📸 Snapshot Test

245 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
0 0 0 0 245 0 N/A

🛸 Powered by Emerge Tools

@joshdholtz joshdholtz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit: ❤️

@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.

This is great! Thank you!

@codecov

codecov Bot commented Mar 4, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.47%. Comparing base (162ad7c) to head (3dd0a0a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2212   +/-   ##
=======================================
  Coverage   80.47%   80.47%           
=======================================
  Files         277      277           
  Lines        9460     9461    +1     
  Branches     1335     1336    +1     
=======================================
+ Hits         7613     7614    +1     
  Misses       1287     1287           
  Partials      560      560           

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

@ajpallares ajpallares merged commit 8bcebc9 into main Mar 4, 2025
@ajpallares ajpallares deleted the offering-has-paywall-property branch March 4, 2025 13:41
tonidero added a commit that referenced this pull request Mar 6, 2025
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Add `hasPaywall` property to `Offering` (#2212) via Antonio Pallares
(@ajpallares)
### 🐞 Bugfixes
* Fix empty options in NoActive subscriptions screen (#2168) via Cesar
de la Vega (@vegaro)

## RevenueCatUI SDK
### Customer Center
#### ✨ New Features
* Create `CustomerCenterListener` (#2199) via Cesar de la Vega (@vegaro)
#### 🐞 Bugfixes
* Reload Customer Center after a successful restore (#2203) via Cesar de
la Vega (@vegaro)
* Fixes CustomerCenter state not refreshing when reopening (#2202) via
Cesar de la Vega (@vegaro)

### 🔄 Other Changes
* Improves PaywallsTester multi-API-key support (#2218) via JayShortway
(@JayShortway)
* [EXTERNAL] Bump Emerge Gradle Plugin and Snaphsots version (#2211) via
@runningcode (#2217) via JayShortway (@JayShortway)
* [AUTOMATIC][Paywalls V2] Updates Compose previews of all templates
(#2207) via RevenueCat Git Bot (@RCGitBot)
* [Paywalls V2] Enables template previews again (#2215) via JayShortway
(@JayShortway)
* Adds support for switching between 2 API keys to PaywallsTester
(#2213) via JayShortway (@JayShortway)
* Adds a `LocalPreviewImageLoader` `CompositionLocal`. (#2201) via
JayShortway (@JayShortway)
* Logs from RevenueCatUI are now tagged with `[Purchases]` too. (#2206)
via JayShortway (@JayShortway)
* [Paywalls V2] Ignores template previews for now. (#2209) via
JayShortway (@JayShortway)
* [Paywalls V2] Some more template previews optimizations (#2208) via
JayShortway (@JayShortway)
* chore: Delete key from customer center survey event (#2204) via
Facundo Menzella (@facumenzella)
* [Paywalls V2] Extract ImageLoader to use a single one (#2146) via Toni
Rico (@tonidero)
* [Paywalls V2] Adds progress indicator to buttons (#2198) via
JayShortway (@JayShortway)
* Avoids triggering "unscheduled" workflows when triggering workflows
via the CircleCI API (#2200) via JayShortway (@JayShortway)
* [Paywalls V2] Adds a note on publishing to the missing paywall error.
(#2193) via JayShortway (@JayShortway)
* Adds X-Kotlin-Version header. (#2197) via JayShortway (@JayShortway)
* [Paywalls V2] Adds docs on ignored arguments for Paywalls V2 in more
places. (#2195) via JayShortway (@JayShortway)
* chore: Add backend integration test for events (#2189) via Facundo
Menzella (@facumenzella)
* [Paywalls V2] Adds CI job to update template previews (#2192) via
JayShortway (@JayShortway)

---------

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Co-authored-by: Cesar de la Vega <cesarvegaro@gmail.com>
Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
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.

4 participants