Message Block Notification Callback
By default, the sender of a message is unaware if the message has been intercepted by RC's content moderation service. If your app wishes to notify the sender when a message is blocked due to triggering moderation rules, you can enable the Blocked Message Status Callback to Sender service.
RC's content moderation service (including message sensitive words, IM moderation service, and message callback service) may intercept messages under the following circumstances:
- The content of a text message triggers RC's built-in sensitive words, preventing the message from being delivered to the recipient.
- The content of a text message triggers your custom sensitive words (blocked words), preventing the message from being delivered to the recipient.
- The message triggers the moderation rules set by the IM Moderation service or the Message Callback Service, preventing the message from being delivered to the recipient.
Enabling the Service
You can enable the Blocked Message Status Callback to Sender feature by navigating to the RC Console, then going to Configuration > Chat settings > Basic features > Security.
Setting Up the Sensitive Words Interception Listener
You can set up a sensitive words interception listener using the onMessageBlocked
method to monitor intercepted messages and the reasons for interception.
Method
Function(RCIMIWBlockedMessageInfo? info)? onMessageBlocked;
Example Usage
engine?.onMessageBlocked = (RCIMIWBlockedMessageInfo? info) {
//...
};
Parameter Description
Parameter | Type | Description |
---|---|---|
info | RCIMIWBlockedMessageInfo | Detailed information about the intercepted message |
-
The
RCIMIWBlockedMessageInfo
object contains relevant information about the intercepted message. You can retrieve this information using the methods listed in the table below:Method Name Description conversationType Retrieves the conversation type of the session where the message was intercepted targetId Retrieves the session ID of the conversation where the message was intercepted blockMsgUId Retrieves the unique ID of the intercepted message blockType Retrieves the reason why the message was intercepted. extra Retrieves additional information about the intercepted message