Skip to main content

Delete channels

ChatUI includes built-in delete functionality in the channel long-press menu.

Channel long-press menu

To customize the delete logic, use the nexconn public API.

Delete a specific channel

Remove the channel from the channel list (does not delete message content).

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

channel.delete { result, error ->
// result == true and error == null indicates success
}

Delete channels in batch

kotlin
val ids = listOf(
ChannelIdentifier(ChannelType.DIRECT, "user_001"),
ChannelIdentifier(ChannelType.GROUP, "group_001")
)

BaseChannel.deleteChannels(ids) { result, error ->
// result == true and error == null indicates success
}
tip

Deleting a channel does not automatically clear its message history. To remove messages, call the message delete API. For details, see Delete messages.