Skip to content

Paywalls: add updateWithDisplayCloseButton to PaywallViewController#3708

Merged
vegaro merged 1 commit into
mainfrom
updateWithDisplayCloseButton
Feb 29, 2024
Merged

Paywalls: add updateWithDisplayCloseButton to PaywallViewController#3708
vegaro merged 1 commit into
mainfrom
updateWithDisplayCloseButton

Conversation

@vegaro

@vegaro vegaro commented Feb 22, 2024

Copy link
Copy Markdown
Member

Add function to be used from the hybrids (RevenueCat/react-native-purchases#913)

@vegaro vegaro force-pushed the updateWithDisplayCloseButton branch from 772cce6 to dc8d10f Compare February 28, 2024 19:07
@vegaro vegaro requested a review from a team February 29, 2024 14:53
@vegaro vegaro marked this pull request as ready for review February 29, 2024 14:53
@vegaro vegaro merged commit aaee331 into main Feb 29, 2024
@vegaro vegaro deleted the updateWithDisplayCloseButton branch February 29, 2024 15:05
joshdholtz added a commit that referenced this pull request Mar 5, 2024
**This is an automatic release.**

### New Features
* Paywalls: add `updateWithDisplayCloseButton` to
`PaywallViewController` (#3708) via Cesar de la Vega (@vegaro)
* New `syncAttributesAndOfferingsIfNeeded` method (#3709) via Burdock
(@lburdock)
* Add targeting to `PresentedOfferingContext` (#3730) via Josh Holtz
(@joshdholtz)
* Add `currentOffering(forPlacement: String)` to `Offerings` (#3707) via
Guido Torres (@guido732)
* New `Package.presentedOfferingContext` (#3712) via Josh Holtz
(@joshdholtz)
### Bugfixes
* Mark methods with StaticString for appUserID as deprecated (#3739) via
Mark Villacampa (@MarkVillacampa)
### Other Changes
* [EXTERNAL] Spelling typo fix to comment (#3713) via @vdeaugustine
(#3740) via Mark Villacampa (@MarkVillacampa)

---------

Co-authored-by: Josh Holtz <me@joshholtz.com>
vegaro added a commit to RevenueCat/react-native-purchases that referenced this pull request Mar 14, 2024
Depends on:
- RevenueCat/purchases-ios#3708
- RevenueCat/purchases-ios#3738
- RevenueCat/purchases-hybrid-common#746

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