/ SDKs / Flutter
SDKs
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Flutter
Version 4

Report a message, user, or channel

Copy link

Users can report suspicious or harassing messages and other users who use abusive language in a channel. They can also report the channel itself if there is any inappropriate content or activity in the channel. Based on this functionality and our Report API, you can build your own in-app system for managing objectionable content and subject.

// Report a channel.
// channel below can be openChannel or groupChannel.
try {
  await channel.report(
    category: REPORT_CATEGORY,
    description: 'DESCRIPTION',
  );
} catch (e) {
  // Handle error.
}

// Report a message in a channel. 
// channel below can be openChannel or groupChannel.
try {
  await channel.reportMessage(
    message: MESSAGE_TO_REPORT,
    category: REPORT_CATEGORY,
    description: 'DESCRIPTION',
  );
} catch (e) {
  // Handle error.
}

// Report a user in a channel.
// channel below can be openChannel or groupChannel.
try {
  await channel.reportUser(
    userId: 'OFFENDING_USER_ID',
    category: REPORT_CATEGORY,
    description: 'DESCRIPTION',
  );
} catch (e) {
  // Handle error.
}

List of parameters

Copy link
Parameter nameTypeDescription

category

ReportCategory

Specifies a report category which indicates the reason for reporting. Acceptable values are suspicious, harassing, spam and inappropriate.

message

BaseMessage

Specifies the message to report for its suspicious, harassing, or inappropriate content.

userId

String

Specifies the user ID who uses offensive or abusive language, such as sending explicit messages.

description

String?

Specifies additional information or note to include in the report.