reportMessage method
Reports an inappropriate message.
Param messageId
The ID of the message to report.
Param tag
The tag of the inappropriate message. You need to type a custom tag, like porn
or ad
.
Param reason
The reporting reason. You need to type a specific reason.
Throws A description of the exception. See ChatError.
Implementation
Future<void> reportMessage({
required String messageId,
required String tag,
required String reason,
}) async {
Map req = {"msgId": messageId, "tag": tag, "reason": reason};
Map result =
await ChatChannel.invokeMethod(ChatMethodKeys.reportMessage, req);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}