destroyChatThread method
~english Disband Chat Thread.
Group owner and group administrator to which the Chat Thread belongs have permission. After chat thread is disbanded, there will be the following notification:
- Members of the organization (group) to which chat thread belongs will receive the disbanded notification event,
and can listen to related events by setting
EMChatThreadEventHandler. The event callback function isEMChatThreadEventHandler.onChatThreadDestroy. - Multiple devices will receive the notification event and you can set
EMMultiDeviceEventHandlerto listen on the event. The event callback function isEMMultiDeviceEventHandler.onChatThreadEvent, where the first parameter is the event, for example,EMMultiDevicesEvent.CHAT_THREAD_DESTROYfor the chat thread destruction event.
Param chatThreadId Chat Thread ID.
Throws A description of the exception. See EMError.
~end
~chinese 解散子区。
@note
只有子区所属群组的群主及管理员可调用该方法。
单设备登录时,子区所在群的所有成员均会收到 EMChatThreadEventHandler.onChatThreadDestroy 。
多端多设备登录时,其他设备会收到 EMMultiDeviceEventHandler.onChatThreadEvent 回调,Event 的值为 EMMultiDevicesEvent.CHAT_THREAD_DESTROY。
Param chatThreadId 子区 ID。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 EMError。
~end
Implementation
Future<void> destroyChatThread({
required String chatThreadId,
}) async {
return Client.instance.chatThreadManager.destroyChatThread(
chatThreadId: chatThreadId,
);
}