destroyChatThread method Null safety
- {required String chatThreadId}
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 {@link EMChatThreadManagerListener}. The event callback function is {@link EMChatThreadManagerListener#onChatThreadDestroyed(EMChatThreadEvent)} .
- Multiple devices will receive the notification event and you can set {@link EMMultiDeviceListener} to listen on the event. The event callback function is {@link EMMultiDeviceListener#onChatThreadEvent(int, String, List)}, where the first parameter is the event, for example, {@link com.hyphenate.EMMultiDeviceListener#EMMultiDevicesEvent.CHAT_THREAD_DESTROY} for the chat thread destruction event.
Param chatThreadId
Chat Thread ID.
Throws A description of the exception. See {@link EMError}.
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;
}
}