From 06ffcf2ee8bab445e0f6661040854f97183b7415 Mon Sep 17 00:00:00 2001 From: wurdigmich Date: Fri, 14 Aug 2026 23:08:50 +0530 Subject: [PATCH] fix(docs): correct handleLog signature in iOS and Android SuperwallDelegate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SuperwallDelegate reference documents handleLog as taking LogLevel and LogScope, but both SDKs declare level and scope as String, and message as optional. This has been the case since 4.0.0 on iOS and across the current Android line. Because LogLevel and LogScope are real public types, the documented signature compiles. And because every delegate method has a default empty implementation, there is no conformance error either — you have simply declared an unrelated method, so the callback never fires and the build stays clean. Corrects the Swift, Kotlin and Java blocks, and adds a note plus a TypeTable row explaining that level and scope are the string forms of the enums. --- .../sdk-reference/SuperwallDelegate.mdx | 19 ++++++++++++++----- .../ios/sdk-reference/SuperwallDelegate.mdx | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/content/docs/android/sdk-reference/SuperwallDelegate.mdx b/content/docs/android/sdk-reference/SuperwallDelegate.mdx index 8a92719a..85e663d8 100644 --- a/content/docs/android/sdk-reference/SuperwallDelegate.mdx +++ b/content/docs/android/sdk-reference/SuperwallDelegate.mdx @@ -46,9 +46,9 @@ interface SuperwallDelegate { fun paywallWillOpenDeepLink(url: String) {} fun handleLog( - level: LogLevel, - scope: LogScope, - message: String, + level: String, + scope: String, + message: String?, info: Map?, error: Throwable? ) {} @@ -87,8 +87,8 @@ public interface SuperwallDelegateJava { default void paywallWillOpenDeepLink(String url) {} default void handleLog( - LogLevel level, - LogScope scope, + String level, + String scope, String message, Map info, Throwable error @@ -96,6 +96,10 @@ public interface SuperwallDelegateJava { } ``` + +`handleLog` receives `level` and `scope` as `String`, not as the `LogLevel` and `LogScope` enums. The SDK passes their string forms — `level` is one of `"DEBUG"`, `"INFO"`, `"WARN"`, `"ERROR"`, or `"NONE"`. To compare against a case, use `toString()`: `level == LogLevel.error.toString()`. + + ## Parameters All methods are optional to implement. Key methods include: @@ -146,6 +150,11 @@ All methods are optional to implement. Key methods include: description: "Called after paywall dismissal.", required: true, }, + handleLog: { + type: "level: String, scope: String, message: String?, info: Map?, error: Throwable?", + description: "Called for every log the SDK generates. `level` and `scope` are string forms of `LogLevel` and `LogScope`, not the enums.", + required: true, + }, }} /> diff --git a/content/docs/ios/sdk-reference/SuperwallDelegate.mdx b/content/docs/ios/sdk-reference/SuperwallDelegate.mdx index 4d63aca0..b27431b7 100644 --- a/content/docs/ios/sdk-reference/SuperwallDelegate.mdx +++ b/content/docs/ios/sdk-reference/SuperwallDelegate.mdx @@ -49,9 +49,9 @@ public protocol SuperwallDelegate: AnyObject { @MainActor func handleLog( - level: LogLevel, - scope: LogScope, - message: String, + level: String, + scope: String, + message: String?, info: [String: Any]?, error: Error? ) @@ -67,6 +67,10 @@ public protocol SuperwallDelegate: AnyObject { } ``` + +`handleLog` receives `level` and `scope` as `String`, not as the `LogLevel` and `LogScope` enums. The SDK passes their string descriptions — `level` is one of `"DEBUG"`, `"INFO"`, `"WARN"`, `"ERROR"`, or `"NONE"`. To compare against a case, use its description: `level == LogLevel.error.description`. + + ## Parameters All methods are optional to implement. Key methods include: @@ -117,6 +121,11 @@ All methods are optional to implement. Key methods include: description: "Called when user attributes change outside your app (for example via the \u201cSet user attributes\u201d paywall action).", required: true, }, + handleLog: { + type: "level: String, scope: String, message: String?, info: [String: Any]?, error: Error?", + description: "Called for every log the SDK generates. `level` and `scope` are string descriptions of `LogLevel` and `LogScope`, not the enums.", + required: true, + }, }} />