Skip to main content

Channel Draft

Chat UI SDK supports draft display and channel list refresh by default.

Channel draft

Usage

The default channel screen requires no additional configuration.

Customization

Save Draft

kotlin
val identifier = ChannelIdentifier(ChannelType.DIRECT, "user_001")

NCChatUI.saveDraft(identifier, "Draft content") { result, error ->
// result == true and error == null indicates success
}

Clear Draft

kotlin
val channel = NCChatUI.createChannel(
ChannelIdentifier(ChannelType.DIRECT, "user_001")
)

channel.clearDraft { result, error ->
// Clear draft
}

Get Draft

There is no standalone getDraft method. Read the BaseChannel.draft property from the channel query result:

kotlin
val id = ChannelIdentifier(ChannelType.DIRECT, "user_001")
BaseChannel.getChannels(listOf(id)) { channels, error ->
val draft = channels?.firstOrNull()?.draft
}