SDK initialization settings
Constructor
init(providerUid: String, appMarker: String? = nil, chatConfig: ChatConfig, loggerConfig: ChatLoggerConfig? = nil)
Constructor parameters:
| Field | Type | Required | Description |
|---|---|---|---|
providerUid | String | Yes | Key for connecting to the service (provided by edna during integration) |
appMarker | String? | No (default nil) | Application marker. Issued during integration if used |
chatConfig | ChatConfig | Yes | Chat settings model. See SDK settings |
loggerConfig | ChatLoggerConfig? | No (default nil — logging disabled) | Logging settings. See Logging |
Example:
let chatCenterSDK = ChatCenterUISDK(
providerUid: "YOUR_PROVIDER_UID",
chatConfig: chatConfig,
loggerConfig: ChatLoggerConfig(logLevel: .all)
)
Static properties
| Property | Type | Description |
|---|---|---|
version | String | Current SDK version |
Example:
print("ChatCenterUI SDK version: \(ChatCenterUISDK.version)")
Instance properties
| Property | Type | Description |
|---|---|---|
theme | ChatTheme | Light theme settings. See Design system. On assignment, overwrites darkTheme with the light theme value — set theme before darkTheme |
darkTheme | ChatTheme | Dark theme settings. If not set separately, values from theme are used |
localizationConfig | ChatLocalizationConfig? | Localization settings. See Localization. Stored in a process-wide static — shared across all SDK instances |
delegate | ChatCenterUISDKDelegate? (weak) | Delegate for handling SDK events (unread counter, network errors, link handling, logging). Because the reference is weak, retain the delegate separately — usually it is the AppDelegate, a coordinator, or another long-lived object; a ViewController that is about to be released cannot be used as the delegate. See SDK delegate |
Example:
// Configure the theme (first light, then dark — otherwise dark gets overwritten)
chatCenterSDK.theme = ChatTheme()
chatCenterSDK.darkTheme = ChatTheme(colors: darkColors)
// Configure the delegate (weak — store self in a long-lived object)
chatCenterSDK.delegate = self
// Configure localization
chatCenterSDK.localizationConfig = ChatLocalizationConfig(
bundle: Bundle.main,
tableName: "MyLocalizable"
)
Related
- SDK settings — the
chatConfigparameter - Logging — the
loggerConfigparameter - Localization —
localizationConfig - SDK delegate —
delegate - Design system —
theme/darkTheme