feat(paywalls) Generic Web View#3501
Draft
JZDesign wants to merge 11 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3501 +/- ##
==========================================
- Coverage 80.11% 80.05% -0.07%
==========================================
Files 371 373 +2
Lines 15166 15259 +93
Branches 2100 2135 +35
==========================================
+ Hits 12150 12215 +65
- Misses 2166 2199 +33
+ Partials 850 845 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: jacob.rakidzich <jacob.rakidzich@revenuecat.com>
Co-authored-by: jacob.rakidzich <jacob.rakidzich@revenuecat.com>
Co-authored-by: jacob.rakidzich <jacob.rakidzich@revenuecat.com>
Co-authored-by: jacob.rakidzich <jacob.rakidzich@revenuecat.com>
Co-authored-by: jacob.rakidzich <jacob.rakidzich@revenuecat.com>
75c3749 to
63a8a3f
Compare
…edownload test
mockk 1.13.11 has no top-level io.mockk.capture; capture is a MockKMatcherScope
member resolved inside the verify {} block. The stray import broke unit-test
compilation for the :purchases module. Removing it restores the build; the
web_view pre-download tests (HTTPS-only, template-skipping, multi-location
traversal, dedup) now compile and pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add support for new WebView schema fields and fallback rendering. WebViewComponent now preserves id, name, protocol_version, a fallback StackComponent and a Capabilities block (with NetworkAccess.allowed_domains). Paywall traversal logic was updated to descend into WebView fallbacks. StyleFactory now builds an optional fallback StackComponentStyle and WebViewComponentStyle carries fallbackStackComponentStyle. ComponentView and WebViewComponentView signatures were extended to forward click handlers and an interaction tracker; the view renders the fallback stack when the resolved URL is invalid. Added and updated tests: WebViewComponent deserialization/tests expanded, pre-downloader test for nested webview fallback, StyleFactory test for fallback creation, and URL resolver tests for disallowed schemes.
Generated by 🚫 Danger |
📸 Snapshot Test593 unchanged
🛸 Powered by Emerge Tools |
Introduce bidirectional messaging for Paywalls V2 web_view components. Adds PaywallWebViewMessage, PaywallWebViewValue, PaywallWebViewController, and PaywallWebViewMessageHandler types, plus a WebViewJavaScriptBridge to safely deliver/receive messages, a parser and message/type constants, and a variables provider that merges SDK-managed and app-provided variables while sanitizing reserved keys. Integrates the handler into PaywallOptions and PaywallState, wires the bridge into WebViewComponentView with proper lifecycle handling, and updates style/component code to carry component IDs. Includes unit tests for value parsing/serialization and bridge-related behavior.
Add PaywallOptionsWebViewHandlerTest to verify builder stores/omits the WebView message handler, that options differing only by handler are not equal, and that hashCode intentionally ignores the handler to avoid spurious state updates. Expand WebViewJavaScriptBridgeTest with additional cases: origin/path validation, rc:step-complete and rc:error handling, malformed message rejection, auto-sending variables without a handler, updating variables/color scheme/locale, protection of envelope identity fields, escaping of U+2028/U+2029 in outbound payloads, and native interface attach/inject/release behavior. These tests improve coverage and ensure stable, secure messaging between the WebView and native layer.
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.
Checklist
purchases-iosand hybridsMotivation
Bring the Android Paywalls V2 asset pre-download path in line with the iOS
jzdesign/test-web-warmingconcept by recognizing web view components and warming their content before rendering.Resolves PWENG-98
Description
web_viewpaywall component model.Verified with:
./gradlew :purchases:testDefaultsBc8DebugUnitTest --tests "com.revenuecat.purchases.utils.OfferingImagePreDownloaderTest" --tests "com.revenuecat.purchases.paywalls.components.WebViewComponentTests" :ui:revenuecatui:testDefaultsBc8DebugUnitTest --tests "com.revenuecat.purchases.ui.revenuecatui.helpers.ContainsUnsupportedConditionTests"./gradlew detektAll