ChatTransportConfig
ChatTransportConfig describes the mobile SDK's connection parameters to the edna Chat Center backend. It is passed in ChatConfig.transportConfig. The class has two constructors:
- Single-host constructor (
cloudHost) — REST and WebSocket endpoints are derived from a single URL.datastoreis left empty, so file upload/download through this config does not work. - Extended constructor — REST, WebSocket, and datastore are specified explicitly. Suitable for non-standard deployments and for working with file attachments.
Connection timeouts and SSL pinning are configured separately — see network_config.
providerUidThe cloudHost value (or rest / webSocket / dataStore in the extended constructor) and providerUid are available to the edna Chat Center administrator on the Android channel's "Setup" tab. Full path and field structure: Connecting the Android mobile chat.
Single-host constructor
Accepts a single URL from which the SDK derives the REST and WebSocket base URLs.
val transportConfig = ChatTransportConfig(
cloudHost = "https://name.edna.io", // full URL with protocol
apiVersion = ChatApiVersion.V16 // V16 by default
)
datastore is not derived from cloudHost — it remains an empty string. If your app uses file upload/download, switch to the extended constructor.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
cloudHost | String | Yes | — | Full backend server URL with protocol (https://name.edna.io). A URL without protocol causes an error during SDK initialization |
apiVersion | ChatApiVersion | No | V16 | Backend API version |
Available ChatApiVersion values
| Value | API version | Note |
|---|---|---|
ChatApiVersion.V16 | 16 | Default |
ChatApiVersion.V17 | 17 | — |
ChatApiVersion.V18 | 18 | — |
ChatApiVersion.V19 | 19 | — |
ChatApiVersion.V20 | 20 | — |
ChatApiVersion.V21 | 21 | Latest version |
The API version must be coordinated with edna technical support — it must match the version of your edna Chat Center backend.
Extended constructor
Used when the app needs file attachments or when REST, WebSocket, and Datastore are hosted on different servers:
val transportConfig = ChatTransportConfig(
rest = "https://rest.example.com",
webSocket = "wss://ws.example.com",
dataStore = "https://datastore.example.com",
dataStoreHTTPHeaders = null, // or mapOf("X-Header" to "value")
apiVersion = ChatApiVersion.V16
)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
rest | String | Yes | — | REST endpoint URL with protocol (https://...) |
webSocket | String | Yes | — | WebSocket endpoint URL with protocol (wss://... for TLS, ws://... for unencrypted) |
dataStore | String | Yes | — | Datastore URL with protocol (file upload/download) |
dataStoreHTTPHeaders | Map<String, String>? | No | — | Additional HTTP headers for the datastore. The parameter has no default — pass null if you have no custom headers (the SDK substitutes an empty Map). |
newRoutesEnabled | Boolean | No | true | Controls the message-history endpoint path: true — api/client/history, false — legacy path history. Does not affect other endpoints. Set false only if your backend does not support the new path |
apiVersion | ChatApiVersion | No | V16 | Backend API version |
The trailing / is handled automatically: for REST and dataStore URLs it is added, for WebSocket it is removed. You can pass URLs with or without the slash. Path and query parameters are preserved as-is.
Related sections
- ChatConfig — where
transportConfigis passed. - Network config — timeouts, SSL pinning.
- Known limitations — hostname verifier and WebSocket reconnect.