deleteRemoteMessagesWithIds method

Future<void> deleteRemoteMessagesWithIds(
  1. {required String conversationId,
  2. required EMConversationType type,
  3. required List<String> msgIds}
)

根据消息ID 单向删除服务器会话中的消息和本地消息。

Param conversationId 会话 ID。

Param type 会话类型。

Param msgIds 需要删除的消息 ID。

Implementation

Future<void> deleteRemoteMessagesWithIds(
    {required String conversationId,
    required EMConversationType type,
    required List<String> msgIds}) async {
  Map request = {
    "convId": conversationId,
    "type": type.index,
    "msgIds": msgIds,
  };
  Map result = await ChatChannel.invokeMethod(
    ChatMethodKeys.removeMessagesFromServerWithMsgIds,
    request,
  );
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}