Skip to main content
Version: 5.9.0

SDK initialization settings

Constructor

init(providerUid: String, appMarker: String? = nil, chatConfig: ChatConfig, loggerConfig: ChatLoggerConfig? = nil)

Constructor parameters:

FieldTypeRequiredDescription
providerUidStringYesKey for connecting to the service (provided by edna during integration)
appMarkerString?No (default nil)Application marker. Issued during integration if used
chatConfigChatConfigYesChat settings model. See SDK settings
loggerConfigChatLoggerConfig?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

PropertyTypeDescription
versionStringCurrent SDK version

Example:

print("ChatCenterUI SDK version: \(ChatCenterUISDK.version)")

Instance properties

PropertyTypeDescription
themeChatThemeLight theme settings. See Design system. On assignment, overwrites darkTheme with the light theme value — set theme before darkTheme
darkThemeChatThemeDark theme settings. If not set separately, values from theme are used
localizationConfigChatLocalizationConfig?Localization settings. See Localization. Stored in a process-wide static — shared across all SDK instances
delegateChatCenterUISDKDelegate? (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"
)