Chat APIs and In-app Messaging SDKs for Developers, by Developers

Applozic powers multi-platform Chat APIs and in-app Messaging SDKs for Android, iOS and the Web that will enable you to build advanced in-app chat solutions your users will love.

Integrate chat in your application with completely customizable UI kits, powerful messaging APIs and SDKs, developed with exceptional security measures in mind.

Documentation    API Explorer

Message Profanity Filter

You can validate messages by using below function
Add this function in the authentication script

validateMessage: function(message) {
  //Add your code to filter messages. Below is the example of filtering phone number
        var phoneRe = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\s\.]{0,1}[0-9]{3}[-\s\.]{0,1}[0-9]{4}$/;
      var digits = message.replace(/\D/g, "");
      return !phoneRe.test(digits);
   }

Example

<script>
window.applozic.init({
   appId: '<APP_ID>',      //Get your App ID from https://console.applozic.com/settings/install
   userId: 'jsfiddle',                     //Logged in user's id, a unique identifier for user
   userName: 'JSFiddler',                 //User's display name
   imageLink : '',                     //User's profile picture url
   email : '',
   contactNumber: '',
   desktopNotification: true,
   notificationIconLink: 'https://www.applozic.com/favicon.ico',    //Icon to show in desktop notification
   validateMessage: function(message) {
     // Profanity filter function
        var phoneRe = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\s\.]{0,1}[0-9]{3}[-\s\.]{0,1}[0-9]{4}$/;
      var digits = message.replace(/\D/g, "");
      return !phoneRe.test(digits);
   },
   onInit : function(response) {
      if (response === "success") {
         // login successful, perform your actions if any, for example: load contacts, getting unread message count, etc
      } else {
         // error in user login/register (you can hide chat button or refresh page)
      }
  },
  contactDisplayName: function(otherUserId) {
        //return the display name of the user from your application code based on userId.
        return "";
  },
  contactDisplayImage: function(otherUserId) {
        //return the display image url of the user from your application code based on userId.
        return "";
  }
 });
<script>

Updated about a year ago


What's Next

Chat Logout

Message Profanity Filter


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.