Skip to content

Add presented offering context to paywall events#818

Merged
rickvdl merged 2 commits into
mainfrom
rickvdl/add-presented-offering-context-to-paywall-events
Jun 2, 2026
Merged

Add presented offering context to paywall events#818
rickvdl merged 2 commits into
mainfrom
rickvdl/add-presented-offering-context-to-paywall-events

Conversation

@rickvdl

@rickvdl rickvdl commented Mar 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Include placement_identifier, targeting_revision, and targeting_rule_id in paywall events under a presented_offering_context nested object
  • Field is omitted when no placement or targeting data exists
  • Consistent with iOS and Android implementations

Related PRs

Test plan

  • Unit tests for all context permutations (full, placement-only, targeting-only, none, empty string)
  • JSON round-trip serialization tests
  • Integration test verifying context flows from offering to event payload
  • Manual testing with targeting rules and placements in demo app

@rickvdl rickvdl force-pushed the rickvdl/add-presented-offering-context-to-paywall-events branch 2 times, most recently from 1a5be31 to 93f8425 Compare April 28, 2026 10:26
@rickvdl rickvdl marked this pull request as ready for review April 28, 2026 11:43
Include placement_identifier, targeting_revision, and targeting_rule_id
in paywall events when available, nested under presented_offering_context.
The field is omitted entirely when no placement or targeting data exists.
Matches the iOS and Android implementations.
@rickvdl rickvdl force-pushed the rickvdl/add-presented-offering-context-to-paywall-events branch from 93f8425 to 27b98b8 Compare June 2, 2026 10:18
@rickvdl rickvdl requested review from a team and nicfix June 2, 2026 10:22

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a small comment... but looking good in any case. Thanks for adding this!

Comment thread src/behavioural-events/paywall-event.ts Outdated

function toPresentedOfferingContextPayload(
context: PresentedOfferingContext | undefined,
): PresentedOfferingContextPayload | undefined {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NABD, but I've usually preferred returning null to undefined...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah right, fixed :)

@rickvdl rickvdl merged commit b9daa96 into main Jun 2, 2026
6 checks passed
@rickvdl rickvdl deleted the rickvdl/add-presented-offering-context-to-paywall-events branch June 2, 2026 12:16
RCGitBot added a commit that referenced this pull request Jun 4, 2026
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Add presented offering context to paywall events (#818) via Rick
(@rickvdl)
### 🐞 Bugfixes
* [WEB-4304] fix: Force billing address collection in Express Checkout
element (#891) via Víctor Ferrer García (@vicfergar)

### 🔄 Other Changes
* Bump jwt from 2.10.2 to 2.10.3 (#895) via dependabot[bot]
(@dependabot[bot])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants