From 700b8fff99f1bc1fd6c92a2ad7cfefd8880e79dc Mon Sep 17 00:00:00 2001 From: Ian Rumac Date: Thu, 7 Nov 2024 12:51:39 +0100 Subject: [PATCH 1/2] Fix issue with paywalls erroring out when loading icons --- superwall/build.gradle.kts | 2 +- .../src/main/java/com/superwall/sdk/paywall/vc/PaywallView.kt | 2 +- .../superwall/sdk/paywall/vc/web_view/DefaultWebviewClient.kt | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/superwall/build.gradle.kts b/superwall/build.gradle.kts index b2916eda..d8a7111b 100644 --- a/superwall/build.gradle.kts +++ b/superwall/build.gradle.kts @@ -23,7 +23,7 @@ plugins { id("signing") } -version = "1.4.0-beta.2" +version = "1.4.0-beta.3" android { compileSdk = 34 diff --git a/superwall/src/main/java/com/superwall/sdk/paywall/vc/PaywallView.kt b/superwall/src/main/java/com/superwall/sdk/paywall/vc/PaywallView.kt index feaf2f38..516d5d8e 100644 --- a/superwall/src/main/java/com/superwall/sdk/paywall/vc/PaywallView.kt +++ b/superwall/src/main/java/com/superwall/sdk/paywall/vc/PaywallView.kt @@ -701,7 +701,7 @@ class PaywallView( if (useMultipleUrls) { webView.loadPaywallWithFallbackUrl(paywall) } else { - webView.loadUrl(url.toString()) + webView.loadUrl(url.value) } } diff --git a/superwall/src/main/java/com/superwall/sdk/paywall/vc/web_view/DefaultWebviewClient.kt b/superwall/src/main/java/com/superwall/sdk/paywall/vc/web_view/DefaultWebviewClient.kt index f69a4649..fc82c162 100644 --- a/superwall/src/main/java/com/superwall/sdk/paywall/vc/web_view/DefaultWebviewClient.kt +++ b/superwall/src/main/java/com/superwall/sdk/paywall/vc/web_view/DefaultWebviewClient.kt @@ -44,6 +44,10 @@ internal open class DefaultWebviewClient( request: WebResourceRequest?, errorResponse: WebResourceResponse?, ) { + val requestUrl = request?.url.toString() + if (requestUrl.contains("favicon.ico")) { + return + } ioScope.launch { webviewClientEvents.emit( WebviewClientEvent.OnError( From 5c1b48cb1a4ed7cea6eeb4b0cd5751b704f5d3e2 Mon Sep 17 00:00:00 2001 From: Ian Rumac Date: Thu, 7 Nov 2024 12:53:28 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 986a15e0..d64e0f53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ The changelog for `Superwall`. Also see the [releases](https://github.com/superwall/Superwall-Android/releases) on GitHub. +## 1.4.0-beta.3 + +- Fixes issue where paywalls without fallback would fail to load and missing resource would cause a failure event + ## 1.4.0-beta.2 ## Enhancements