Messaging APIs - Content Moderation and Filtering Messages
mesibo allows you to filter both incoming and outgoing messages as per the content moderation policy of your app, for example, profanity, personal details, URLs, file type, size, etc. It is up to you to decide what is inappropriate for your app.
You can filter each incoming or outgoing message by implementing the Mesibo_onMessageFilter
listener. The mesibo APIs will call your Mesibo_onMessageFilter
listener every time a new real-time message is received or sent. You can return true
to pass the message or false
to drop the message.
You can also restrict the type and size of the files sent by your users by calling getFile()
and checking the type, size, and path.
If you are using Mesibo Messaging UI, it sets the UI context which you can use to show an appropriate message while blocking. You can get the UI context (Activity on Android, UIViewController on iOS) by calling getUiContext()
. If you have implemented your UI, you can set UI context from your UI using setUiContext()
so that your filtering function can access it.
boolean Mesibo_onMessageFilter(MesiboMessage msg) {
/* check various fields to decide if incoming or outgoing messages are to be dropped */
if(msg.isOutgoing()) {
MesiboFile file = msg.getFile();
String message = msg.message;
}
return true;
}
Server-Side Filtering
If you are using mesibo on-premise, you can deploy a script or a module to filter all the messages as per the content moderation policy of your app. Refer to the on-premise documentation for details.
You can also use the mesibo scripting platform to filter messages on the server.