Skip to content

Add displayCloseButton option to PaywallView#913

Merged
vegaro merged 2 commits into
mainfrom
dismissButtonPaywallView
Mar 14, 2024
Merged

Add displayCloseButton option to PaywallView#913
vegaro merged 2 commits into
mainfrom
dismissButtonPaywallView

Conversation

@vegaro

@vegaro vegaro commented Feb 22, 2024

Copy link
Copy Markdown
Member

Depends on:

With this PR, there's a change in functionality in the way the dismissal of the paywall works in iOS.

In iOS I noticed there was a bug that prevented the onDismiss callback from getting called when using PaywallView after dismissal of the paywall, and I also noticed that the paywall was getting automatically dismissed. In Android, I noticed the behavior was different, and the paywall wouldn't close by itself and the onDismiss would be called, so the PaywallView could be dismissed by the developer.

Taking into account the way React Native views work, I think the developer should have the responsability of not showing the paywall (dimissing it). So I consider Android implemntation's the correct one.

Those PRs (RevenueCat/purchases-ios#3738 and RevenueCat/purchases-hybrid-common#746) make some changes in the way iOS behaves, so if the view is created from PaywallProxy, which is what React Native uses to create a PaywallView the view wouldn't close itself after the close button is pressed (or a successful purchase happens). It's a change in behavior, but I think it's a actually something we overlooked in iOS implementation's. Also, take into account that PaywallView in iOS used to do self.dismiss, which I believe would only work if the PaywallView in React Native is being presented using something like Navigator, where the dismiss event would bubble up and close the container controller.

@vegaro

vegaro commented Feb 23, 2024

Copy link
Copy Markdown
Member Author

This works in Android, but in iOS the onDismiss doesn't get called in iOS so I won't open until I figure it out 🤔

@vegaro vegaro force-pushed the dismissButtonPaywallView branch from 69fc32c to de18be2 Compare February 28, 2024 20:11
@vegaro vegaro force-pushed the dismissButtonPaywallView branch from de18be2 to ab308ab Compare February 29, 2024 14:33
vegaro added a commit to RevenueCat/purchases-ios that referenced this pull request Feb 29, 2024
@vegaro vegaro force-pushed the dismissButtonPaywallView branch from ab308ab to 45978cf Compare March 11, 2024 17:49
vegaro added a commit to RevenueCat/purchases-ios that referenced this pull request Mar 13, 2024
vegaro added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Mar 14, 2024
@vegaro vegaro force-pushed the dismissButtonPaywallView branch from 45978cf to f32bdbd Compare March 14, 2024 15:47
@vegaro vegaro force-pushed the dismissButtonPaywallView branch from f32bdbd to 1b6b059 Compare March 14, 2024 16:17
@vegaro vegaro marked this pull request as ready for review March 14, 2024 16:27
@vegaro vegaro requested a review from a team March 14, 2024 16:27

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@vegaro vegaro enabled auto-merge (squash) March 14, 2024 16:32
@vegaro vegaro merged commit 2dd0167 into main Mar 14, 2024
@vegaro vegaro deleted the dismissButtonPaywallView branch March 14, 2024 16:36
vegaro pushed a commit that referenced this pull request Mar 14, 2024
**This is an automatic release.**

### New Features
* Add `displayCloseButton` option to `PaywallView` (#913) via Cesar de
la Vega (@vegaro)
### Dependency Updates
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 10.2.0 (#940) via
RevenueCat Git Bot (@RCGitBot)
* [Android
7.7.2](https://github.com/RevenueCat/purchases-android/releases/tag/7.7.2)
* [iOS
4.39.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.39.0)
* [iOS
4.38.1](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.1)
* [iOS
4.38.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.0)
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 10.1.0 (#938) via
RevenueCat Git Bot (@RCGitBot)
* [Android
7.7.2](https://github.com/RevenueCat/purchases-android/releases/tag/7.7.2)
* [iOS
4.39.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.39.0)
* [iOS
4.38.1](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.1)
* [iOS
4.38.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.0)
### Other Changes
* Make hotfixes not deploy with the latest tag nor update latest docs
(#937) via Toni Rico (@tonidero)
* Update RELEASING.md (#936) via Cesar de la Vega (@vegaro)
* Add 6.7.2 to changelog (#935) via Cesar de la Vega (@vegaro)

---------

Co-authored-by: RevenueCat CI <dev+ci@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants