Skip to main content

Message Block Notification Callback

By default, message senders are not aware if their messages have been intercepted by RC's moderation service. If your app wants to notify the sender when a message is blocked due to triggering moderation rules, you can enable the Message Block Notification Callback service.

RC's content moderation service (including message sensitive words, IM moderation service, and message callback service) may block messages in the following scenarios:

  • The content of a text message hits RC's built-in sensitive words, causing the message not to be delivered to the recipient.
  • The content of a text message hits your custom sensitive words (blocked sensitive words), causing the message not to be delivered to the recipient.
  • The message hits the moderation rules set by the IM moderation service or the message callback service, causing the message not to be delivered to the recipient.

Enable the Service

You can enable the Blocked Message Status Callback to Sender feature in the RC Console by navigating to Configuration > Chat settings > Basic features > Security.

Set Up the Sensitive Words Block Listener

You can set up a sensitive words block listener using the onMessageBlocked method to listen for blocked messages and the reasons for blocking.

Method

setOnMessageBlockedListener(listener?: (info: RCIMIWBlockedMessageInfo) => void): void;

Example


engine?.setOnMessageBlockedListener((info: RCIMIWBlockedMessageInfo) => {
//...
});

Parameter Description

ParameterTypeDescription
infoRCIMIWBlockedMessageInfoDetailed information about the blocked message
  • RCIMIWBlockedMessageInfo contains relevant information about the blocked message, which you can retrieve using the methods listed in the table below:

    Method NameDescription
    conversationTypeRetrieves the conversation type of the conversation where the message was blocked
    targetIdRetrieves the conversation Id of the conversation where the message was blocked
    blockMsgUIdRetrieves the unique Id of the blocked message
    blockTypeRetrieves the reason why the message was blocked.
    extraRetrieves additional information about the blocked message
  • RCIMIWMessageBlockType Description

| Enum    | Description       |
| :----- | :-------- |
| UNKNOWN | Unknown |
| GLOBAL | Global sensitive words: Hits RC's built-in global sensitive words |
| CUSTOM | Custom sensitive words: Hits custom sensitive words defined by the client in RC |
| THIRD_PARTY | Third-party moderation: Hits third-party (Shumei) or template routing decisions that prevent delivery |