-
Notifications
You must be signed in to change notification settings - Fork 319
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
: always dismiss paywalls automatically after a purchase
#3517
Conversation
Paywall Tester
: fix automatic dismissing after purchasingPaywalls Tester
: fix automatic dismissing after purchasing
Fixes #3516. This logic only existed for `.presentPaywallIfNeeded`. However, it should apply to `PaywallView` when presented manually as well. This is also consistent with how Android works, reduces boilerplate code required by users, and removes the possibility that a paywall is still presented after a purchase, which doesn't make sense since our paywalls don't have a mode for "already subscribed".
99d605a
to
054b98c
Compare
Paywalls Tester
: fix automatic dismissing after purchasingPaywalls
: always dismiss paywalls automatically after a purchase
@@ -179,8 +179,6 @@ private struct PresentingPaywallModifier: ViewModifier { | |||
) | |||
.onPurchaseCompleted { | |||
self.purchaseCompleted?($0) | |||
|
|||
self.close() |
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 is done by PaywallView
automatically now.
.onChangeOf(self.purchaseHandler.purchased) { purchased in | ||
if purchased { | ||
Logger.debug(Strings.dismissing_paywall) | ||
self.dismiss() |
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 wonder if this could be considered a breaking change somewhat... Since people might have had to handle this before, would they be dismissing the paywall twice with this now?
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.
Even if they do, I tested it and there is no difference :) The double-dismissal becomes a no-op.
Follow up to #3517. This behavior is the default and not opt-in, and it doesn't make sense on footer paywalls.
### Motivation `onChangeOf` was accidentally made public in #3517 ### Description - Change scope of `onChangeOf` from `public` to `internal` - Added breaking change in v5 migration doc
### Motivation `onChangeOf` was accidentally made public in #3517 ### Description - Change scope of `onChangeOf` from `public` to `internal` - Added breaking change in v5 migration doc
### Motivation `onChangeOf` was accidentally made public in #3517 ### Description - Change scope of `onChangeOf` from `public` to `internal` - Added breaking change in v5 migration doc
### Motivation `onChangeOf` was accidentally made public in #3517 ### Description - Change scope of `onChangeOf` from `public` to `internal` - Added breaking change in v5 migration doc
### Motivation `onChangeOf` was accidentally made public in #3517 ### Description - Change scope of `onChangeOf` from `public` to `internal` - Added breaking change in v5 migration doc
Fixes #3516.
This logic only existed for
.presentPaywallIfNeeded
. However, it should apply toPaywallView
when presented manually as well.This is also consistent with how Android works, reduces boilerplate code required by users, and removes the possibility that a paywall is still presented after a purchase, which doesn't make sense since our paywalls don't have a mode for "already subscribed".