Skip to content

Expose trackCustomPaywallImpression as experimental public API#3199

Merged
rickvdl merged 4 commits into
mainfrom
rickvdl/track-custom-paywall-impression-experimental-api
Mar 12, 2026
Merged

Expose trackCustomPaywallImpression as experimental public API#3199
rickvdl merged 4 commits into
mainfrom
rickvdl/track-custom-paywall-impression-experimental-api

Conversation

@rickvdl

@rickvdl rickvdl commented Mar 9, 2026

Copy link
Copy Markdown
Member

Description

Exposes trackCustomPaywallImpression as an experimental public API, allowing hybrid SDKs and consumers to track impressions of custom (non-RevenueCat) paywalls.

Changes

  • New CustomPaywallEventParams class gated behind @ExperimentalPreviewRevenueCatPurchasesAPI
  • Public trackCustomPaywallImpression method on Purchases
  • API tester and Metalava API surface updates

Related PRs


Note

Medium Risk
Introduces new public (experimental) API surface on Purchases, which can affect binary compatibility and downstream integrations if the signature or opt-in semantics change.

Overview
Exposes Purchases.trackCustomPaywallImpression as an experimental public API (with overloads) to let apps track impressions for custom/non-RevenueCat paywalls, accepting optional paywallId via the new CustomPaywallImpressionParams type.

Replaces the prior internal params type, updates API tester coverage (Java/Kotlin) to exercise the new calls, and refreshes Metalava API surface files and unit tests accordingly.

Written by Cursor Bugbot for commit 3896706. This will update automatically on new commits. Configure here.

@rickvdl rickvdl force-pushed the rickvdl/track-custom-paywall-impression-experimental-api branch from 495835c to b58bc1e Compare March 9, 2026 16:33
@codecov

codecov Bot commented Mar 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.18%. Comparing base (425aac0) to head (3896706).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...s/paywalls/events/CustomPaywallImpressionParams.kt 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3199      +/-   ##
==========================================
- Coverage   79.19%   79.18%   -0.01%     
==========================================
  Files         356      356              
  Lines       14272    14273       +1     
  Branches     1945     1945              
==========================================
  Hits        11302    11302              
- Misses       2165     2166       +1     
  Partials      805      805              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Missing @JvmOverloads for Java callers with default parameter
    • Added @JvmOverloads to trackCustomPaywallImpression so Java callers get a zero-argument overload when using default params.

Create PR

Or push these changes by commenting:

@cursor push f50804ba11
Preview (f50804ba11)
diff --git a/purchases/src/defaults/kotlin/com/revenuecat/purchases/Purchases.kt b/purchases/src/defaults/kotlin/com/revenuecat/purchases/Purchases.kt
--- a/purchases/src/defaults/kotlin/com/revenuecat/purchases/Purchases.kt
+++ b/purchases/src/defaults/kotlin/com/revenuecat/purchases/Purchases.kt
@@ -653,6 +653,7 @@
      */
     @ExperimentalPreviewRevenueCatPurchasesAPI
     @OptIn(InternalRevenueCatAPI::class)
+    @JvmOverloads
     public fun trackCustomPaywallImpression(params: CustomPaywallEventParams = CustomPaywallEventParams()) {
         purchasesOrchestrator.track(
             CustomPaywallEvent.Impression(
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread purchases/src/defaults/kotlin/com/revenuecat/purchases/Purchases.kt Outdated

@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.

I think this looks good! Just some small comments

Comment thread purchases/src/defaults/kotlin/com/revenuecat/purchases/Purchases.kt Outdated
@rickvdl rickvdl added pr:feat A new feature and removed pr:other labels Mar 11, 2026
@rickvdl rickvdl force-pushed the rickvdl/track-custom-paywall-impression-experimental-api branch from b58bc1e to 4374ce2 Compare March 11, 2026 16:25
@rickvdl rickvdl force-pushed the rickvdl/track-custom-paywall-impression-experimental-api branch from 4374ce2 to 01bb7fa Compare March 12, 2026 06:09
@rickvdl rickvdl force-pushed the rickvdl/track-custom-paywall-impression-experimental-api branch from ddfda04 to 3896706 Compare March 12, 2026 09:01

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread purchases/api-entitlement.txt
@rickvdl rickvdl added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit 449c51b Mar 12, 2026
31 checks passed
@rickvdl rickvdl deleted the rickvdl/track-custom-paywall-impression-experimental-api branch March 12, 2026 10:47
github-merge-queue Bot pushed a commit that referenced this pull request Mar 12, 2026
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Expose trackCustomPaywallImpression as experimental public API (#3199)
via Rick (@rickvdl)

### 🔄 Other Changes
* [EXTERNAL] Migrate deprecated kotlinOptions to compilerOptions (#3219)
contributed by @AlexanderTalledo (#3223) via Toni Rico (@tonidero)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk release bookkeeping: bumps version strings and updates
docs/changelogs and CI docs deploy paths, without changing runtime logic
beyond version reporting.
> 
> **Overview**
> Publishes the `9.25.0` release by removing `-SNAPSHOT` across the repo
(Gradle `VERSION_NAME`, internal `Config.frameworkVersion`, and
sample/test app dependency version catalogs).
> 
> Updates release documentation metadata: adds `9.25.0` to
`CHANGELOG.md`, refreshes `CHANGELOG.latest.md`, points
`docs/index.html` to `9.25.0`, and changes CircleCI `docs-deploy` to
sync docs to the `9.25.0` S3 path.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e8615d4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
rickvdl added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Mar 12, 2026
## Description

Adds bridge methods for `trackCustomPaywallImpression` on both iOS and
Android, enabling hybrid SDKs to call the new experimental native API.

### Changes
- iOS: `trackCustomPaywallImpression(_ data:)` in
`CommonFunctionality.swift`
- Android: `trackCustomPaywallImpression(data)` in `common.kt`

Both methods accept a dictionary with an optional `paywallId` key and
delegate to the native SDK.

### Related PRs
- purchases-ios: RevenueCat/purchases-ios#6427
- purchases-android:
RevenueCat/purchases-android#3199
- react-native-purchases:
RevenueCat/react-native-purchases#1660
rickvdl added a commit to RevenueCat/purchases-unity that referenced this pull request Mar 17, 2026
## Summary
- Add `trackCustomPaywallImpression` API to the Unity SDK, wiring
through the existing hybrid-common bridge on both iOS and Android
- Introduce `CustomPaywallImpressionParams` class with an optional
`PaywallId`
- Pass `CustomPaywallImpressionParams` through the wrapper interface,
splitting into separate arguments only at the native bridge boundary
- Add a testing UI in the Subtester app's Paywall screen with an
optional paywall ID field

## Changes
- **New file:** `CustomPaywallImpressionParams.cs` — params class with
optional `PaywallId`
- **Interface:** `IPurchasesWrapper` — added
`TrackCustomPaywallImpression(CustomPaywallImpressionParams)`
- **Public API:** `Purchases.cs` — two overloads (with params,
parameterless)
- **iOS bridge:** `PurchasesWrapperiOS.cs` + `PurchasesUnityHelper.m` —
DllImport and ObjC bridge calling `[RCCommonFunctionality
trackCustomPaywallImpression:]`
- **Android bridge:** `PurchasesWrapperAndroid.cs` +
`PurchasesWrapper.java` — CallPurchases and static method calling
`CommonKt.trackCustomPaywallImpression()`
- **No-op:** `PurchasesWrapperNoop.cs` — empty stub
- **API tests:** `PurchasesAPITests.cs` — compile-time verification of
both overloads
- **Subtester:** `PaywallScreen.cs` — "Custom Paywall Events" section
with paywall ID field and button

### Related PRs
- purchases-ios: RevenueCat/purchases-ios#6427
- purchases-android:
RevenueCat/purchases-android#3199
- purchases-hybrid-common:
RevenueCat/purchases-hybrid-common#1537
- react-native-purchases:
RevenueCat/react-native-purchases#1660
- purchases-flutter:
RevenueCat/purchases-flutter#1679
- purchases-capacitor:
RevenueCat/purchases-capacitor#725

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Rick van der Linden <rick.vanderlinden@revenuecat.com>
rickvdl added a commit to RevenueCat/react-native-purchases that referenced this pull request Mar 17, 2026
## Summary
- Add `trackCustomPaywallImpression` API to React Native, enabling
developers to track impressions of custom (non-RevenueCat) paywalls for
analytics
- Add purchase tester demo screen for testing custom paywall impressions

## Changes
- **iOS bridge:** `RCT_EXPORT_METHOD(trackCustomPaywallImpression:)` in
`RNPurchases.m`
- **Android bridge:** `@ReactMethod trackCustomPaywallImpression` in
`RNPurchasesModule.java`
- **TypeScript:** `Purchases.trackCustomPaywallImpression()` in
`purchases.ts` with optional `paywallId` parameter
- **Purchase tester:** Added a demo Custom Paywall screen for testing
impressions

### Related PRs
- purchases-ios: RevenueCat/purchases-ios#6427
- purchases-android:
RevenueCat/purchases-android#3199
- purchases-hybrid-common:
RevenueCat/purchases-hybrid-common#1537
- purchases-flutter:
RevenueCat/purchases-flutter#1679
- purchases-capacitor:
RevenueCat/purchases-capacitor#725
rickvdl added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Mar 18, 2026
…PI (#1565)

## Summary
- Read `offeringId` from the data dictionary in
`trackCustomPaywallImpression` on both iOS and Android bridge layers
- Pass it through to the native `CustomPaywallImpressionParams`,
allowing hybrid SDKs to override the default offering identifier

## Related PRs
- purchases-ios: RevenueCat/purchases-ios#6427
- purchases-android:
RevenueCat/purchases-android#3199
- react-native-purchases:
RevenueCat/react-native-purchases#1660
- purchases-unity:
RevenueCat/purchases-unity#863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants