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: always dismiss paywalls automatically after a purchase #3517

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

NachoSoto
Copy link
Contributor

@NachoSoto NachoSoto commented Dec 13, 2023

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".

@NachoSoto NachoSoto added the test label Dec 13, 2023
@NachoSoto NachoSoto requested a review from a team December 13, 2023 17:14
@NachoSoto NachoSoto changed the title Paywall Tester: fix automatic dismissing after purchasing Paywalls Tester: fix automatic dismissing after purchasing Dec 13, 2023
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".
@NachoSoto NachoSoto changed the title Paywalls Tester: fix automatic dismissing after purchasing Paywalls: always dismiss paywalls automatically after a purchase Dec 13, 2023
@NachoSoto NachoSoto added pr:RevenueCatUI pr:fix A bug fix and removed test labels Dec 13, 2023
@@ -179,8 +179,6 @@ private struct PresentingPaywallModifier: ViewModifier {
)
.onPurchaseCompleted {
self.purchaseCompleted?($0)

self.close()
Copy link
Contributor Author

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()
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@NachoSoto NachoSoto merged commit 34e0045 into main Dec 14, 2023
19 of 20 checks passed
@NachoSoto NachoSoto deleted the paywalls-ipad-links branch December 14, 2023 17:29
tonidero added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Dec 19, 2023
tonidero added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Dec 20, 2023
NachoSoto added a commit that referenced this pull request Feb 13, 2024
Follow up to #3517.
This behavior is the default and not opt-in, and it doesn't make sense on footer paywalls.
NachoSoto added a commit that referenced this pull request Feb 13, 2024
Follow up to #3517.

This behavior is the default and not opt-in, and it doesn't make sense
on footer paywalls.
joshdholtz added a commit that referenced this pull request Apr 10, 2024
### Motivation

`onChangeOf` was accidentally made public in #3517 

### Description

- Change scope of `onChangeOf` from `public` to `internal`
- Added breaking change in v5 migration doc
fire-at-will pushed a commit that referenced this pull request Apr 15, 2024
### Motivation

`onChangeOf` was accidentally made public in #3517 

### Description

- Change scope of `onChangeOf` from `public` to `internal`
- Added breaking change in v5 migration doc
fire-at-will pushed a commit that referenced this pull request May 13, 2024
### Motivation

`onChangeOf` was accidentally made public in #3517 

### Description

- Change scope of `onChangeOf` from `public` to `internal`
- Added breaking change in v5 migration doc
fire-at-will pushed a commit that referenced this pull request Jun 24, 2024
### Motivation

`onChangeOf` was accidentally made public in #3517 

### Description

- Change scope of `onChangeOf` from `public` to `internal`
- Added breaking change in v5 migration doc
fire-at-will pushed a commit that referenced this pull request Jun 28, 2024
### Motivation

`onChangeOf` was accidentally made public in #3517 

### Description

- Change scope of `onChangeOf` from `public` to `internal`
- Added breaking change in v5 migration doc
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.

Paywall with 'displayCloseButton: true' not closing automatically after successful purchase
2 participants