Skip to content

Paywalls: new onDismiss parameter for presentPaywallIfNeeded#3342

Merged
NachoSoto merged 1 commit into
mainfrom
paywalls-dismiss-callback
Oct 26, 2023
Merged

Paywalls: new onDismiss parameter for presentPaywallIfNeeded#3342
NachoSoto merged 1 commit into
mainfrom
paywalls-dismiss-callback

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

Without this there is no way to know when the paywall was dismissed.

@NachoSoto NachoSoto requested a review from a team October 24, 2023 23:04

Logger.debug(Strings.dismissing_paywall)

self.data = nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just re-ordered this because the log says "dismissing", not "dismissed".

func body(content: Content) -> some View {
content
.sheet(item: self.$data) { data in
.sheet(item: self.$data, onDismiss: self.onDismiss) { data in

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tested this and it gets called when closing the sheet manually by the user and programatically.

Unfortunately I wasn't able to write a unit test that gets called because of the way we hack adding SwiftUI views to the hierarchy without a host app in the test target.

Without this there is no way to know when the paywall was dismissed.
@NachoSoto NachoSoto force-pushed the paywalls-dismiss-callback branch from 3b3f17b to a02b6f9 Compare October 24, 2023 23:06
@codecov

codecov Bot commented Oct 25, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (50bd457) 85.98% compared to head (a02b6f9) 85.96%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3342      +/-   ##
==========================================
- Coverage   85.98%   85.96%   -0.02%     
==========================================
  Files         237      237              
  Lines       17086    17086              
==========================================
- Hits        14691    14688       -3     
- Misses       2395     2398       +3     

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joshdholtz joshdholtz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💯

@NachoSoto NachoSoto merged commit 94ec58e into main Oct 26, 2023
@NachoSoto NachoSoto deleted the paywalls-dismiss-callback branch October 26, 2023 03:25
NachoSoto added a commit that referenced this pull request Oct 26, 2023
**This is an automatic release.**

### New Features
* `PaywallColor`: change visibility of `Color.init(light:dark:)` to
`private` (#3345) via NachoSoto (@NachoSoto)
### RevenueCatUI
* `Paywalls`: new `.onPurchaseCompleted` overload with
`StoreTransaction` (#3323) via NachoSoto (@NachoSoto)
* `Paywalls`: finished template 5 (#3340) via NachoSoto (@NachoSoto)
* `Paywalls`: new `onDismiss` parameter for `presentPaywallIfNeeded`
(#3342) via NachoSoto (@NachoSoto)
* `Paywalls`: disable shimmering on footer loading view (#3324) via
NachoSoto (@NachoSoto)
### Bugfixes
* `ErrorUtils.purchasesError(withSKError:)`: handle `URLError`s (#3346)
via NachoSoto (@NachoSoto)
### Other Changes
* `Paywalls`: add identifier to events (#3332) via Josh Holtz
(@joshdholtz)
* `Paywalls`: create new event session when paywall appears (#3330) via
Josh Holtz (@joshdholtz)
* `HTTPClient`: verbose logs for request IDs (#3320) via NachoSoto
(@NachoSoto)
* `Paywalls Tester`: fix `macOS` build (#3341) via NachoSoto
(@NachoSoto)
* `ProductFetcherSK1`: enable `TimingUtil` log (#3327) via NachoSoto
(@NachoSoto)
* `Paywall Tester`: fixed paywall presentation (#3339) via NachoSoto
(@NachoSoto)
* `CI`: replace Carthage build jobs with `xcodebuild` (#3338) via
NachoSoto (@NachoSoto)
* `Integration Tests`: use repetition count from test plan (#3329) via
NachoSoto (@NachoSoto)
* `Integration Tests`: new logs for troubleshooting flaky tests (#3328)
via NachoSoto (@NachoSoto)
* `CircleCI`: change iOS 17 job to use M1 Large resource (#3322) via
NachoSoto (@NachoSoto)
* `Paywalls Tester`: fix release build (#3321) via NachoSoto
(@NachoSoto)
* `Paywalls`: enable all iOS 17 tests (#3331) via NachoSoto (@NachoSoto)
* `CI`: added workaround for Snapshots in `Xcode Cloud` (#2857) via
NachoSoto (@NachoSoto)
* `StoreKit 1`: disabled `finishTransactions` log on observer mode
(#3314) via NachoSoto (@NachoSoto)

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
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.

2 participants