deleteRemoteConversation method Null safety
- String conversationId,
- {ChatConversationType conversationType = ChatConversationType.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 ChatConversationType}.
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 ChatError}.
Implementation
Future<void> deleteRemoteConversation(
String conversationId, {
ChatConversationType conversationType = ChatConversationType.Chat,
bool isDeleteMessage = true,
}) async {
Map req = {};
req["conversationId"] = conversationId;
if (conversationType == ChatConversationType.Chat) {
req["conversationType"] = 0;
} else if (conversationType == ChatConversationType.GroupChat) {
req["conversationType"] = 1;
} else {
req["conversationType"] = 2;
}
req["isDeleteRemoteMessage"] = isDeleteMessage;
Map data = await ChatMethodChannel.ChatManager.invokeMethod(
ChatMethodKeys.deleteRemoteConversation, req);
ChatError.hasErrorFromResult(data);
}