recallMessage method

Future<void> recallMessage(
  1. String messageId,
  2. {String? ext}
)

撤回发送成功的消息。

Param messageId 消息 ID。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError

Implementation

Future<void> recallMessage(String messageId, {String? ext}) async {
  Map req = {
    "msg_id": messageId,
  };
  req.putIfNotNull('ext', ext);
  Map result =
      await ChatChannel.invokeMethod(ChatMethodKeys.recallMessage, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}