-
Notifications
You must be signed in to change notification settings - Fork 54
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
Paywall events: Send paywall data with post receipt requests #1452
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1452 +/- ##
=======================================
Coverage 83.99% 84.00%
=======================================
Files 206 208 +2
Lines 6843 6888 +45
Branches 992 999 +7
=======================================
+ Hits 5748 5786 +38
- Misses 705 712 +7
Partials 390 390
☔ View full report in Codecov by Sentry. |
import com.revenuecat.purchases.paywalls.events.PaywallEventType | ||
|
||
@OptIn(ExperimentalPreviewRevenueCatPurchasesAPI::class) | ||
internal class PaywallPresentedCache { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice abstraction!
val event = lastPaywallImpressionEvent | ||
lastPaywallImpressionEvent = null | ||
return event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically a race condition. Is it possible to synchronize getAndRemovePresentedEvent
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! We can synchronize the methods instead. Great catch!
storeAppUserID = any(), | ||
marketplace = any(), | ||
initiationSource = any(), | ||
paywallPostReceiptData = expectedPaywallData, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
ecf55d6
to
20707b9
Compare
cc98c49
to
ff488da
Compare
**This is an automatic release.** ### RevenueCatUI * `Paywalls`: improve error log when images fail to load (#1454) via NachoSoto (@NachoSoto) ### Other Changes * Paywall events: Send paywall data with post receipt requests (#1452) via Toni Rico (@tonidero) * Paywalls: Track paywall events (#1447) via Toni Rico (@tonidero) * Paywall events: Handle errors parsing specific paywall event lines (#1451) via Toni Rico (@tonidero) * Paywalls: Move logic for events file helper to common generic class (4) (#1446) via Toni Rico (@tonidero) * Paywalls: Add paywall events flush logic and tests (3) (#1445) via Toni Rico (@tonidero) * Paywalls: Support sending paywall events to servers (2) (#1442) via Toni Rico (@tonidero) * `CircleCI`: fix `record-revenuecatui-snapshots` (#1455) via NachoSoto (@NachoSoto) * Lower request jitter log level from warning to debug (#1453) via Toni Rico (@tonidero) Co-authored-by: revenuecat-ops <[email protected]>
Description
This sends the paywall data during the post receipt requests to make sure we attribute purchases to paywalls. We do this by caching the paywall events as needed.