-
Notifications
You must be signed in to change notification settings - Fork 307
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
: open Terms and Privacy Policy links in-app
#3475
Conversation
Since we don't know what the navigation stack looks like, what if we always open the links in a fullscreen modal? We could use the system setting for light/dark mode to set a light/dark header. I think this approach would work with the footer views too since we're always overlaying the fullscreen, and the close action is always dismissing the view. No navigation push/pop. |
I agree that makes more sense. Just not sure if you can present a modal on top of a modal, in case the developer is presenting the paywall as a modal already? |
Yeah, the modal thing might feel weird if you're already in a modal. One alternative is to make this remotely controllable from a variable |
How does this look on iPad, and visionOS? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense and it's a better UX 👍🏻
RevenueCatUI/Views/FooterView.swift
Outdated
@@ -257,6 +257,23 @@ private struct LinkButton: View { | |||
|
|||
} | |||
|
|||
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) | |||
@available(watchOS, unavailable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FooterView
is used on watchOS
too, so I think we need to keep the existing implementation for watchOS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe visionOS
and Catalyst
?
RevenueCatUI/Views/FooterView.swift
Outdated
return WKWebView() | ||
} | ||
|
||
func updateUIView(_ uiView: WKWebView, context: Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the state of your app changes, SwiftUI updates the portions of your interface affected by those changes. SwiftUI calls this method for any changes affecting the corresponding UIKit view. Use this method to update the configuration of your view to match the new state information provided in the context parameter.
Since this doesn't depend on the context
, we should load the url in makeUIView
. Otherwise this might be loaded multiple times unnecessarily.
Just watched the video. Perhaps we should present this as a sheet. Right now it shows a navigation bar which doesn't make a lot of sense since the controller doesn't have a title. |
6bbba63
to
8f82621
Compare
@@ -13,6 +13,7 @@ | |||
|
|||
import RevenueCat | |||
import SwiftUI | |||
import WebKit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't exist on watchOS 😅
} | ||
} | ||
#else | ||
Link(destination: self.url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the existing implementation if WebKit
isn't supported.
Updated to use a sheet. Presenting a sheet on top of a sheet is a common pattern supported by iOS (see video) |
Paywalls
: open Terms and Privacy Policy links in-app
Follow up to #3475. This new implementation doesn't make sense (and doesn't work very well) on Catalyst. It will now fall back to the previous implementation and open the link on a new window (using the default system browser).
**This is an automatic release.** ### RevenueCatUI * `Paywalls`: improve image caching (#3498) via NachoSoto (@NachoSoto) * `Paywalls`: change style of CTA button to be consistent with other platforms (#3507) via NachoSoto (@NachoSoto) * `Paywalls`: open footer links on Safari on Catalyst (#3508) via NachoSoto (@NachoSoto) * `Paywalls`: fix compilation on Xcode < 14.3 (#3513) via NachoSoto (@NachoSoto) * Fix typo in zh-Hans localization of RevenueCatUI (#3512) via Francis Feng (@francisfeng) * `Paywalls`: fix PaywallViewControllerDelegate access from Objective-C (#3510) via noncenz (@noncenz) * `Paywalls`: open Terms and Privacy Policy links in-app (#3475) via Andy Boedo (@aboedo) * `Paywalls`: fix empty description when using `custom` package type and `{{ sub_period }}` (#3495) via Andy Boedo (@aboedo) * `Paywalls`: use `HEIC` images (#3496) via NachoSoto (@NachoSoto) * Paywalls: disable the close button when an action is in progress (#3474) via Andy Boedo (@aboedo) * `Paywalls`: adjusted German translations (#3476) via Tensei (@tensei) * Paywalls: Improve Chinese localization (#3489) via Andy Boedo (@aboedo) ### Other Changes * `CircleCI`: add git credentials to snapshot generation (#3506) via NachoSoto (@NachoSoto) * `StoreProduct`: improve `priceFormatter` documentation (#3500) via NachoSoto (@NachoSoto) * `Paywalls`: fix tests (#3499) via NachoSoto (@NachoSoto) * `Optimization`: changed `first` to `first(where:)` (#3467) via NachoSoto (@NachoSoto)
Oh thanks! We'll get that fixed 🙏🏻 |
@stuart-j-williams I'm unable to reproduce this, could you please file an issue including:
Thanks! |
These seemed to be the default before, but it broke with #3475.
These seemed to be the default before, but it broke with #3475. Difference (before and after): ![Screenshot 2023-12-18 at 15 09 51](https://github.com/RevenueCat/purchases-ios/assets/685609/1e2e8c69-51b0-4500-8e30-28e4c357907d) This restores the layout shown on the left side.
Updated the terms and Privacy Policy links to open within the app, without exiting to Safari
RocketSim_Recording_iPhone_15_Pro_Max_6.7_2023-12-08_10.42.51.mp4