Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions content/docs/android/sdk-reference/SuperwallDelegate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Any>?,
error: Throwable?
) {}
Expand Down Expand Up @@ -87,15 +87,19 @@ public interface SuperwallDelegateJava {
default void paywallWillOpenDeepLink(String url) {}

default void handleLog(
LogLevel level,
LogScope scope,
String level,
String scope,
String message,
Map<String, Object> info,
Throwable error
) {}
}
```

<Note>
`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()`.
</Note>

## Parameters
All methods are optional to implement. Key methods include:

Expand Down Expand Up @@ -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<String, Any>?, 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,
},
}}
/>

Expand Down
15 changes: 12 additions & 3 deletions content/docs/ios/sdk-reference/SuperwallDelegate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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?
)
Expand All @@ -67,6 +67,10 @@ public protocol SuperwallDelegate: AnyObject {
}
```

<Note>
`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`.
</Note>

## Parameters
All methods are optional to implement. Key methods include:

Expand Down Expand Up @@ -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,
},
}}
/>

Expand Down