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

PaywallViewController: new initializer with Offering identifier #3587

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

NachoSoto
Copy link
Contributor

Depends on #3586.

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

@NachoSoto NachoSoto requested a review from a team January 19, 2024 18:31

// MARK: -

internal extension Optional where Wrapped == String {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this to String+Extensions since it makes more sense there. This file is also now sym-linked so it can be used by RevenueCatUI.

@@ -56,14 +50,45 @@ public class PaywallViewController: UIViewController {
/// `Offerings.current` will be used by default.
/// - Parameter fonts: An optional ``PaywallFontProvider``.
/// - Parameter displayCloseButton: Set this to `true` to automatically include a close button.
public init(
public convenience init(
Copy link
Contributor

Choose a reason for hiding this comment

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

just a question I have, there's only one @objc annotated method in this file, but we don't use it in phc, because it's written in Swift... is it exposed for folks that are using objective c? If so, should we expose another constructor?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also in the docs of this constructor it says "an optional PaywallFontProvider", but it's not optional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is it exposed for folks that are using objective c?

Yeah that's correct, because PaywallFontProvider isn't available in Swift.
I'll add another one with offering identifier for ObjC

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And fixed the docs, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think I'm not going to do that. The ideal way is passing an Offering to minimize the chances that you'll pass something that won't be found. The offeringIdentifier one is just for us for the hybrids. Other users should pass Offerings

vegaro pushed a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Jan 22, 2024
Base automatically changed from paywall-view-load-by-offering to main January 22, 2024 15:12
Depends on #3586.

This will be used by the hybrid SDKs to be able to load paywalls with an offering identifier.
@NachoSoto NachoSoto force-pushed the paywall-view-load-by-offering-2 branch from 39b0c76 to fe45714 Compare January 22, 2024 15:46
@NachoSoto NachoSoto enabled auto-merge (squash) January 22, 2024 15:51
@NachoSoto NachoSoto merged commit 2f1a4e0 into main Jan 22, 2024
24 checks passed
@NachoSoto NachoSoto deleted the paywall-view-load-by-offering-2 branch January 22, 2024 17:00
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>
NachoSoto added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Jan 23, 2024
NachoSoto added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Jan 23, 2024
NachoSoto added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Jan 23, 2024
NachoSoto added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants