deleteRemoteConversation method Null safety
- String conversationId,
- {EMConversationType conversationType = EMConversationType.Chat,
- bool isDeleteMessage = true}
Deletes the specified conversation and the related historical messages from the server.
Param conversationId
The conversation ID.
Param conversationType
The conversation type. See {@link EMConversationType}.
Param isDeleteMessage
Whether to delete the chat history when deleting the conversation.
true
: (default) Yes.false
: No.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<void> deleteRemoteConversation(
String conversationId, {
EMConversationType conversationType = EMConversationType.Chat,
bool isDeleteMessage = true,
}) async {
Map req = {};
req["conversationId"] = conversationId;
if (conversationType == EMConversationType.Chat) {
req["conversationType"] = 0;
} else if (conversationType == EMConversationType.GroupChat) {
req["conversationType"] = 1;
} else {
req["conversationType"] = 2;
}
req["isDeleteRemoteMessage"] = isDeleteMessage;
Map data = await EMMethodChannel.ChatManager.invokeMethod(
ChatMethodKeys.deleteRemoteConversation, req);
EMError.hasErrorFromResult(data);
}