reportMessage method
举报消息。
Param messageId 要举报的消息 ID。
Param tag 非法消息的标签。你需要填写自定义标签,例如涉政或广告。
Param reason 举报原因。你需要自行填写举报原因。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。
Implementation
Future<void> reportMessage({
required String messageId,
required String tag,
required String reason,
}) async {
try {
Map req = {"msgId": messageId, "tag": tag, "reason": reason};
Map result = await platform_interface.Client.instance.chatManager
.callNativeMethod(ChatMethodKeys.reportMessage, req);
ChatError.hasErrorFromResult(result);
} catch (e) {
rethrow;
}
}