Skip to content
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

Add RevenueCatUI module and initial API #1213

Merged
merged 6 commits into from
Sep 6, 2023

Conversation

tonidero
Copy link
Contributor

Description

This PR creates a new module :ui:revenuecatui as a starting point for paywalls. Additionally, it adds some initial code for the public API.

@tonidero tonidero added the refactor A code change that neither fixes a bug nor adds a feature label Aug 30, 2023
implementation libs.androidx.lifecycle.viewmodel
implementation libs.androidx.lifecycle.viewmodel.compose
debugImplementation libs.compose.ui.tooling
debugImplementation libs.androidx.test.compose.manifest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of this is copied over from the debugview module

@tonidero tonidero marked this pull request as ready for review August 30, 2023 11:17
@tonidero tonidero requested a review from a team August 30, 2023 11:17
@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

❗ No coverage uploaded for pull request base (paywalls@c170c6d). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##             paywalls    #1213   +/-   ##
===========================================
  Coverage            ?   85.25%           
===========================================
  Files               ?      186           
  Lines               ?     6319           
  Branches            ?      911           
===========================================
  Hits                ?     5387           
  Misses              ?      586           
  Partials            ?      346           

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

@NachoSoto
Copy link
Contributor

Nice!!
Should this target a new paywalls branch?

@tonidero
Copy link
Contributor Author

tonidero commented Aug 30, 2023

Nice!! Should this target a new paywalls branch?

I wonder... Since it's a different module, the chances of conflicts are mostly minimized and we have disabled shipping it for now. We might need to once we add changes to the main SDK for the paywall data, but even then, I think it's ok to try to merge into main? I don't think we will have many breaking changes after our we release in iOS... wdyt?

Edit: Talked on Slack, we will keep it in a branch for now

@tonidero tonidero changed the base branch from main to paywalls August 30, 2023 13:47
*/
@Suppress("unused")
@Composable
fun PaywallFooter(options: PaywallFooterOptions = PaywallFooterOptions.Builder().build()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed the PaywallBottomSheet to PaywallFooter, since now this won't include the full screen option. It will still be displayed as a bottom sheet, but it made more sense to keep naming the same as in iOS in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additionally, I moved the parameters to use the builder pattern. My main reasons is that it will be much easier to add/deprecate options in the future. Since this is a function, keeping deprecated parameters can potentially grow and adding new parameters would need to keep the order to be usable.

It will indeed make configuring this sligthly harder... But I think it's acceptable. Lmk if you think otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove this for now until we work on this mode?

In general I don't think this should be its own type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah makes sense! Will remove the footer for now

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe PaywallFooterOptions too?

@tonidero
Copy link
Contributor Author

tonidero commented Sep 4, 2023

I made some changes to the API from our latest conversations. Please lmk what you think @RevenueCat/coresdk ! I still haven't added an API to present the paywall full screen as a dialog, since I want to do a bit more research on that.

@tonidero tonidero merged commit f617e36 into paywalls Sep 6, 2023
7 checks passed
@tonidero tonidero deleted the create-revenuecatui-module branch September 6, 2023 07:29
tonidero added a commit that referenced this pull request Oct 31, 2023
### Description
This PR creates a new module `:ui:revenuecatui` as a starting point for
paywalls. Additionally, it adds some initial code for the public API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A code change that neither fixes a bug nor adds a feature RevenueCatUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants