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: new presentationMode parameter (by @Lascorbe) #3638

Merged
merged 4 commits into from
Feb 6, 2024

Conversation

NachoSoto
Copy link
Contributor

@NachoSoto NachoSoto commented Feb 6, 2024

Original PR: #3632 by Lascorbe.

TLDR

  • Added a way to present PaywallView either as sheet or full screen
  • No breaking changes have been made

Motivation

I wanted to easily present the PaywallView on full screen.

Description

I added a new enum PaywallPresentationMode which currently has 2 options: .sheet and .fullScreen. I added this as a parameter to the current public .presentPaywallIfNeeded modifiers. The default is sheet so there are no breaking changes with the current public API.

Sheet Full Screen
Simulator Screenshot - iPhone 15 Pro - 2024-02-05 at 18 08 51 Simulator Screenshot - iPhone 15 Pro - 2024-02-05 at 18 44 15

Lascorbe and others added 2 commits February 6, 2024 07:59
### TLDR
- Added a way to present `PaywallView` either as sheet or full screen
- No breaking changes have been made

### Motivation
I wanted to easily present the PaywallView on full screen.

### Description
I added a new enum `PaywallPresentationMode` which currently has 2
options: `.sheet` and `.fullScreen `. I added this as a parameter to the
current public `presentPaywallIfNeeded` modifiers. The default is
`sheet` so there are no breaking changes with the current public API.

| Sheet             | Full Screen    |
| ------------- | ------------- |
| ![Simulator Screenshot - iPhone 15 Pro - 2024-02-05 at 18 08
51](https://github.com/RevenueCat/purchases-ios/assets/1515520/80f4c418-5dd7-4ba9-87a3-1b824bd6fc10)
| ![Simulator Screenshot - iPhone 15 Pro - 2024-02-05 at 18 44
15](https://github.com/RevenueCat/purchases-ios/assets/1515520/ab05b52b-6132-41d0-a48b-cecf5b857eeb)
|

PD: I looked for info on how to contribute but it's unclear if I have to
open an issue first or not (contributing says open issue, then when
opening an issue it says please don't open but contact us at
https://app.revenuecat.com/settings/support). I hope this is valid,
otherwise let me know how I can proceed.

---------

Co-authored-by: Luis Ascorbe <luis@caribepixels.com>
Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
@NachoSoto NachoSoto requested a review from a team February 6, 2024 16:26
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

Oh nice addition! I was thinking whether this could apply to Android, but we're already presenting it as full screen when using the PaywallActivityLauncher. With the PaywallDialog composable we are full screen on mobile, and modal on tablets, but people can always use the Paywall composable directly if they have to, so I think we should be fine there.

@NachoSoto NachoSoto force-pushed the presentation-mode branch 2 times, most recently from 39c0c4c to eacefc8 Compare February 6, 2024 17:02
@NachoSoto
Copy link
Contributor Author

Yeah I think this is sort of specific to this platform where SwiftUI offers these 2 options.

@NachoSoto NachoSoto merged commit e227ae5 into main Feb 6, 2024
24 checks passed
@NachoSoto NachoSoto deleted the presentation-mode branch February 6, 2024 18:19
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.

3 participants