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

Paywalls: extracted PaywallViewConfiguration #3586

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

NachoSoto
Copy link
Contributor

The number of parameters was already very large. This refactor combines the different values into its own type.

This is also a preliminary refactor to be able to configure a paywall with an offering identifier instead of an offering, which will be used by the hybrid SDKs.

The number of parameters was already very large. This refactor combines the different values into its own type.
This is also a preliminary refactor to be able to configure a paywall with an offering identifier instead of an offering, which will be used by the hybrid SDKs.
@NachoSoto NachoSoto requested a review from a team January 19, 2024 17:39
Comment on lines +18 to +20
var mode: PaywallViewMode = .default
var fonts: PaywallFontProvider = DefaultPaywallFontProvider()
var displayCloseButton: Bool = false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default value for these is now in a single place instead of being duplicated in several places.

NachoSoto added a commit that referenced this pull request Jan 19, 2024
Depends on #3586.

This will be used by the hybrid SDKs to be able to load paywalls with an offering identifier.
NachoSoto added a commit that referenced this pull request Jan 19, 2024
Depends on #3586.

This will be used by the hybrid SDKs to be able to load paywalls with an offering identifier.
NachoSoto added a commit that referenced this pull request Jan 19, 2024
Depends on #3586.

This will be used by the hybrid SDKs to be able to load paywalls with an offering identifier.

/// Parameters needed to configure a ``PaywallView``.
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
struct PaywallViewConfiguration {
Copy link
Contributor

Choose a reason for hiding this comment

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

In android, this would be similar to PaywallOptions, which is public and it's how developers can customize most things for the paywall. We used the builder pattern there, but I'm not sure if that's so common in swift.

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 we could think about exposing this (and only the public types). We can do that in a separate PR.

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

Just left a comment but I think this PR looks good

@NachoSoto NachoSoto merged commit 25008b0 into main Jan 22, 2024
24 checks passed
@NachoSoto NachoSoto deleted the paywall-view-load-by-offering branch January 22, 2024 15:12
NachoSoto added a commit that referenced this pull request Jan 22, 2024
Depends on #3586.

This will be used by the hybrid SDKs to be able to load paywalls with an offering identifier.
NachoSoto added a commit that referenced this pull request Jan 22, 2024
…3587)

Depends on #3586.

This will be used by the hybrid SDKs to be able to load paywalls with an
offering identifier.
NachoSoto added a commit that referenced this pull request Jan 23, 2024
**This is an automatic release.**

### RevenueCatUI
* `PaywallViewController`: new initializer with `Offering` identifier
(#3587) via NachoSoto (@NachoSoto)
* `Paywalls`: improve template 5 layout for long product names (#3589)
via NachoSoto (@NachoSoto)
### Other Changes
* `Paywalls`: extracted `PaywallViewConfiguration` (#3586) via NachoSoto
(@NachoSoto)
* `CircleCI`: avoid installing `Xcodes` when not needed (#3585) via
NachoSoto (@NachoSoto)
* `CircleCI`: change all jobs to M1 (#3140) via NachoSoto (@NachoSoto)

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
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.

3 participants