Paywalls: Add dismissal method in PaywallViewControllerDelegate#3493
Conversation
|
|
||
| public override func viewDidDisappear(_ animated: Bool) { | ||
| if isBeingDismissed { | ||
| self.delegate?.paywallViewControllerDismissed?(self) |
There was a problem hiding this comment.
I'm not certain this is the best way to do this. Afaik, in iOS, the presenter is usually in charge of dismissing the presented VC, but not sure if the same applies to modals, where it can be dismissed by user interaction. And we want to know when it's dismissed so the hybrids can return a result at that point in time. Any feedback would be welcome @aboedo @NachoSoto
There was a problem hiding this comment.
the footer wouldn't own the modal anyway, right? I think we should just leave it up to the owner of the view that has a footer in it to dismiss the whole thing, which in turn will kill the footer
There was a problem hiding this comment.
Right, this is a bit confusing, but this fix is for the old approach of presenting the paywall as a modal in the hybrids and fix the issue I mentioned in the description... But yeah, if we end up moving to using views, this becomes unnecessary.
ba41e5b to
ec31b28
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3493 +/- ##
==========================================
+ Coverage 86.06% 86.07% +0.01%
==========================================
Files 237 237
Lines 17211 17211
==========================================
+ Hits 14812 14814 +2
+ Misses 2399 2397 -2 ☔ View full report in Codecov by Sentry. |
**This is an automatic release.** ### RevenueCatUI * `Paywalls`: add `PaywallFooterViewController` (#3486) via Toni Rico (@tonidero) * `Paywalls`: improve landscape support of all templates (#3471) via NachoSoto (@NachoSoto) * `Paywalls`: ensure footer links open in full-screen sheets (#3524) via NachoSoto (@NachoSoto) * `Paywalls`: improve `FooterView` text alignment (#3525) via NachoSoto (@NachoSoto) * Paywalls: Add dismissal method in `PaywallViewControllerDelegate` (#3493) via Toni Rico (@tonidero)
Description
This adds a new method to the
PaywallViewControllerDelegateto indicate when thePaywallViewControlleris dismissed.This will be useful to listen to responses in the hybrids, since we need to present the paywall and wait until it's been purchased/dismissed before returning a value for the hybrids.
This will be needed to fix: RevenueCat/purchases-flutter#886