feat(paywalls): wire web_view messaging into the paywall (PWENG-98)#3653
feat(paywalls): wire web_view messaging into the paywall (PWENG-98)#3653alexrepty wants to merge 1 commit into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
44cef80 to
05817c6
Compare
05817c6 to
026a97f
Compare
026a97f to
e1a5a58
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alexrepty/paywalls-web-view-bridge #3653 +/- ##
===================================================================
Coverage 80.54% 80.54%
===================================================================
Files 401 401
Lines 16606 16606
Branches 2373 2373
===================================================================
Hits 13376 13376
Misses 2291 2291
Partials 939 939 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1704224 to
e63218e
Compare
4778498 to
8e1dbd2
Compare
e63218e to
aab1540
Compare
8e1dbd2 to
411faa5
Compare
8483042 to
7b32cdc
Compare
411faa5 to
87c761e
Compare
7b32cdc to
b712772
Compare
87c761e to
462969f
Compare
462969f to
ec0e9e1
Compare
b712772 to
9627fbf
Compare
ec0e9e1 to
9a5e9d8
Compare
9627fbf to
5fcb286
Compare
9a5e9d8 to
b9e2d15
Compare
5fcb286 to
6b3546c
Compare
6b3546c to
b7e4c63
Compare
b9e2d15 to
7459bad
Compare
7459bad to
01a65f3
Compare
b7e4c63 to
35d1a2c
Compare
5d63768 to
9d63625
Compare
35d1a2c to
39fe849
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9d63625. Configure here.
Adds a bidirectional JS<->native bridge for the Paywalls V2 `web_view` component: a document-start `window.RevenueCatWebView` shim, message parsing/validation (`WebViewMessageParser`, `WebViewMessageType`), the public `PaywallWebViewMessage` / `PaywallWebViewValue` / `PaywallWebViewMessageHandler` / `PaywallWebViewController` surface, and an SDK-managed variables provider (locale, color scheme, custom variables). Apps opt in via `PaywallOptions.setWebViewMessageHandler(...)`, threaded through `PaywallState` / `OfferingToStateMapper`. Regenerates ui/revenuecatui/api.txt for the new public API. Recommended labels: pr:feat, pr:RevenueCatUI, feat:Paywalls_V2
9d63625 to
ee282eb
Compare
39fe849 to
28307d9
Compare


Checklist
purchases-iosand hybridsMotivation
Exposes
web_viewbidirectional messaging to integrating apps and installs the bridge in the rendered paywall — the final piece that makes the feature usable end to end.Resolves PWENG-98.
Description
PaywallOptions.setWebViewMessageHandler(...)opt-in, threaded throughPaywallState/OfferingToStateMapper/PaywallViewModel.WebViewComponentViewconstructs and lifecycle-manages the bridge per renderedweb_view(scoped by the componentid), refreshinglocale/ handler across recompositions and tearing it down on release.componentIdto the web_view style/factory and regeneratesui/revenuecatui/api.txtfor the new public handler API.PaywallOptionsWebViewHandlerTest.iOS parity: mirrors
purchases-ios(web-view-bridge-wiring) (onPaywallWebViewMessagethere).Stack (merge bottom-up): schema → rendering → CSP → value types → message model → variables provider → JS bridge → wiring.
Note
Medium Risk
Touches WebView JS bridging and a new public callback surface; mistakes could affect message delivery or WebView lifecycle, but purchase/dismiss are not auto-triggered by messages.
Overview
Adds
PaywallOptions.setWebViewMessageHandler(public API +api.txt) so apps can observe Paywalls V2web_viewmessages and reply viaPaywallWebViewController. The handler is threaded throughPaywallState.Loaded.Components,OfferingToStateMapper, andPaywallViewModel.WebViewComponentViewnow creates aWebViewJavaScriptBridgeper rendered web view when the style has acomponentId(new field fromWebViewComponent.idinStyleFactory), injects the shim on page start, refreshes locale/handler on recomposition, and releases on dispose. Handler-onlyupdateOptionschanges refresh in place (handler excluded fromhashCode, like the listener) without rebuilding paywall state; workflow pre-warmed steps get the same stamp.Tests cover builder/equality/hash behavior and view-model/workflow handler refresh.
Reviewed by Cursor Bugbot for commit ee282eb. Bugbot is set up for automated code reviews on this repo. Configure here.