sendMessage

abstract suspend fun sendMessage(message: String): Result<ConversationEntry>

Sends a text message in this conversation.

If this is the first message and pre-chat is configured with "Every Session" display frequency, call submitRemoteConfiguration first to avoid an HTTP 417 error.

Return

Result.Success with the sent ConversationEntry, or Result.Error on failure.

Parameters

message

The text content to send.

See also

Samples

val result = conversationClient.sendMessage("Hello, I need help with my order")
when (result) {
    is Result.Success -> {
        // Entry is persisted locally before sending, so it already
        // appears in conversationEntries/conversationEntriesFlow
    }
    is Result.Error -> { /* Show send failure UI, offer retry */ }
    else -> {}
}