Paywalls: create new event session when paywall appears#3330
Merged
Conversation
NachoSoto
approved these changes
Oct 24, 2023
NachoSoto
left a comment
Contributor
There was a problem hiding this comment.
Looks great! Just a few suggestions.
| } | ||
|
|
||
| self.track(.close(data.withCurrentDate())) | ||
| self.eventData = nil |
Contributor
There was a problem hiding this comment.
I'd add another test to verify that cancelling purchases doesn't reset this (so you can track close after a purchase cancels).
Base automatically changed from
paywalls-ios-17-tests
to
paywalls-purchase-completed-transaction
October 24, 2023 00:52
9a29ba3 to
d7795f3
Compare
Paywalls: create new even session when paywall appearsPaywalls: create new event session when paywall appears
Base automatically changed from
paywalls-purchase-completed-transaction
to
main
October 24, 2023 03:43
NachoSoto
approved these changes
Oct 24, 2023
| guard self.session.lastPaywall != newPaywall else { return } | ||
|
|
||
| self.session.lastPaywall = newPaywall | ||
| self.session.id = .init() |
Contributor
There was a problem hiding this comment.
You can remove this now.
The current API only provided a `CustomerInfo`. Note that this does not include `userCanceled`. We can expose separately with another `.onPurchaseCancelled` modifier in the future.
These were failing in some of the earlier Xcode 15 betas, but they all seem to be passing now. `PresentIfNeededTests` are still not working though. But I just manually verified that these modifiers do work correctly on iOS 17 on an app.
…e failing test right now)
93e699e to
ffbd794
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3330 +/- ##
=======================================
Coverage 85.95% 85.96%
=======================================
Files 237 237
Lines 17081 17081
=======================================
+ Hits 14682 14683 +1
+ Misses 2399 2398 -1 ☔ View full report in Codecov by Sentry. |
NachoSoto
approved these changes
Oct 24, 2023
NachoSoto
left a comment
Contributor
There was a problem hiding this comment.
Let's just remove the session state property now :)
NachoSoto
reviewed
Oct 24, 2023
Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
NachoSoto
approved these changes
Oct 24, 2023
This was referenced Oct 25, 2023
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Prevent
paywall_impressionandpaywall_closebe recorded multiple times for the same session (which could happen if samePaywallViewis displayed multiple times)Description
PaywallView'sonAppearwill always create/update the sessionPurchaseHandlertrackPaywallImpression()will store thePaywallEvent.Datafor cancel and close to usetrackPaywallClose()will seteventDatatonilso that close can only be called once