addReaction method

Future<void> addReaction(
  1. {required String messageId,
  2. required String reaction}
)

添加 Reaction。

Param messageId 要添加 Reaction 的消息 ID。

Param reaction Reaction 的内容。

Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 详见 EMError

Implementation

Future<void> addReaction({
  required String messageId,
  required String reaction,
}) async {
  Map req = {"reaction": reaction, "msgId": messageId};
  Map result =
      await ChatChannel.invokeMethod(ChatMethodKeys.addReaction, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}