destroyChatThread method

Future<void> destroyChatThread({
  1. required String chatThreadId,
})

~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:

  1. 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 is EMChatThreadEventHandler.onChatThreadDestroy.
  2. Multiple devices will receive the notification event and you can set EMMultiDeviceEventHandler to listen on the event. The event callback function is EMMultiDeviceEventHandler.onChatThreadEvent, where the first parameter is the event, for example, EMMultiDevicesEvent.CHAT_THREAD_DESTROY for 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 {
  Map req = {
    "threadId": chatThreadId,
  };
  Map result = await _channel.invokeMethod(
    ChatMethodKeys.destroyChatThread,
    req,
  );
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}