ChatConfig
ChatConfig is the main SDK configuration container. It is passed to ChatCenterUI.init(...) or ChatCenterUI.initAsync(...) and defines network, push, input, and permission settings.
Network timeouts, SSL pinning, and backend connection are configured in separate configs: transport_config, network_config.
Constructor parameters
val chatConfig = ChatConfig(
transportConfig = ChatTransportConfig(cloudHost = "https://your.edna.io"),
networkConfig = ChatNetworkConfig()
)
The ChatConfig constructor accepts 14 parameters — most are optional.
| Parameter | Type | Modifiable | Required | Default | Description |
|---|---|---|---|---|---|
transportConfig | ChatTransportConfig | val | Yes | — | Server connection settings. See Transport config |
networkConfig | ChatNetworkConfig | val | Yes | — | Timeout and SSL settings. See Network config |
keepWebSocketActive | Boolean | var | No | false | Keep the WebSocket open after closing the chat. Deprecated — controlled by the server. |
searchEnabled | Boolean | var | No | false | Message search. Deprecated — controlled by the server. |
attachmentsEnabled | Boolean | val | No | true | Show the attach button |
linkPreviewEnabled | Boolean | var | No | false | Link previews (OpenGraph). Deprecated — controlled by the server. |
voiceRecordingEnabled | Boolean | var | No | false | Voice messages. Deprecated — controlled by the server. |
permissionsDescriptionDialogsEnabled | Boolean | val | No | false | Show dialogs explaining permission requests |
autoScrollToLatest | Boolean | val | No | false | Auto-scroll to the latest messages. Deprecated — controlled by the server. |
notificationImportance | Int | val | No | IMPORTANCE_DEFAULT | Notification channel priority. Applies on Android 8.0 (API 26) and above; on earlier versions, the value is ignored. See the warning below the table |
surveyCompletionDelay | Int | val | No | 3 | Survey hide delay, seconds. Deprecated — controlled by the server. |
inputEnabledDuringQuickReplies | Boolean | val | No | false | Allow text input while quick replies are shown |
pendingIntentCreator | PendingIntentCreator | var | No | Opens ChatActivity | How to build the PendingIntent on a notification tap. See the example below |
keepSocketActiveDuringOperatorSession | Boolean | var | No | false | Keep the WebSocket while an operator dialog is open. Deprecated — controlled by the server. |
The full list of deprecated parameters and their server-side replacements is in Deprecated parameters.
Android registers the notification channel once. After the first push, the channel is created, and subsequent changes to notificationImportance will not affect it — until the app is reinstalled or the channel is manually reset in Android settings.
userInputEnabled
userInputEnabled is set only on an existing ChatConfig instance — it is not part of the constructor.
| Property | Type | Default | Description |
|---|---|---|---|
userInputEnabled | Boolean | true | Whether the input field is available to the user. The field is not declared @Volatile: a write from a background thread does not guarantee visibility of the value in the chat. |
val chatConfig = ChatConfig(
transportConfig = transportConfig,
networkConfig = networkConfig
)
chatConfig.userInputEnabled = false // temporarily block the input field
PendingIntentCreator
By default, a notification tap opens the built-in ChatActivity. If the app already has a host Activity through which the chat is opened, replacing pendingIntentCreator helps avoid opening two chat instances.
create() is called from NotificationWorker (WorkManager) on a background thread — you must not touch the UI inside the method. The appMarker parameter comes from the push message and may be null (in particular, for campaign notifications) or an empty string.
chatConfig.pendingIntentCreator = object : PendingIntentCreator {
override fun create(context: Context, appMarker: String?): PendingIntent? {
val intent = Intent(context, HostActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP
putExtra("open_chat", true)
}
var flags = PendingIntent.FLAG_CANCEL_CURRENT
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
flags = flags or PendingIntent.FLAG_IMMUTABLE
}
// requestCode must be unique: the same value for different Intents
// leads to mutual overwrite of the PendingIntent in the system.
return PendingIntent.getActivity(context, Random().nextInt(), intent, flags)
}
}
FLAG_IMMUTABLE is available since Android 6.0 (API 23). On Android 12 (API 31) and above, with targetSdk = 31+, PendingIntent.getActivity() requires one of the flags to be specified: FLAG_IMMUTABLE or FLAG_MUTABLE — otherwise it throws IllegalArgumentException. The SDK_INT >= M guard in the example is kept for compatibility with minSdk < 23.
Fields inherited from ChatConfigCore
These fields are inherited from the base ChatConfigCore class and are accessible on a ChatConfig instance via inheritance. They are read-only: they cannot be passed to the ChatConfig(...) constructor and cannot be reassigned.
| Property | Type | Default | Description |
|---|---|---|---|
historyLoadingCount | Int | 30 | Number of messages loaded when paging history. Deprecated — controlled by the server. |
isShowClientFullNameInMessage | Boolean | true | Show the client's full name in messages or "You" |
Deprecated parameters
Constructor parameters marked @Deprecated — the values now come from the server.
| Parameter | Default | Replacement | Note |
|---|---|---|---|
keepWebSocketActive | false | Server setting | On Android 15+ (targetSdk = 35), background network access is not allowed by the system unless the app is in foreground. On earlier versions, subject to Doze, App Standby, and background network restrictions |
keepSocketActiveDuringOperatorSession | false | Server setting | — |
searchEnabled | false | Server setting | History search |
linkPreviewEnabled | false | Server setting | Link previews (OpenGraph) |
voiceRecordingEnabled | false | Server setting | Voice message recording |
autoScrollToLatest | false | Server setting | Auto-scroll |
surveyCompletionDelay | 3 | Server setting | Survey hide delay (seconds) |
The historyLoadingCount field is also marked @Deprecated, but you cannot pass it to the ChatConfig constructor — it stays at the default 30. See Fields inherited from ChatConfigCore.