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.

Guides    API Explorer


NativeScript authentication guide

Creating a User object

A User object needs to be initialised and then authenticated to use Applozic's features. A user object has a unique field userId which is also the only mandatory field. You can create a User object as below:

var alUser = {
            'userId' : userId,   //Replace it with the userId of the logged in user NOTE : userId need to be string and  +,*,? are not allowed chars in userId.
            'password' : password,  //Put password here
            'authenticationTypeId' : 1,
            'applicationId' : 'applozic-sample-app',  //replace "applozic-sample-app" with App ID from Applozic Dashboard
            'deviceApnsType' : 0    //Set 0 for Development and 1 for Distribution (Release)

Registering/Logging-in the user



Please remember you have to log in once and only after you log out you must log in again. Use below code to check if the user is already logged in.

You can check if the user is logged in to applozic or not by using:

           if(response === 'true'){
             // User is already logged in
           }else if(response === 'false'){
             // User isn't logged in yet
         },function(error) {

You can authenticate the user with Applozic using the below methods. If the login request is from a new user then a new user account is created. If the user is an existing user then user authentication details are validated by the server.

applozicChat.login(alUser, function(response) {
        //login success callback here
      }, function(error) {
        //login failure callback here

where applozicChat is the instance of the Applozic chat plugin. You can initialise it as below:

var nativescript_applozic_chat = require("nativescript-applozic-chat");
import { ApplozicChat } from "nativescript-applozic-chat";

And then inside your function:

var applozicChat = new nativescript_applozic_chat.ApplozicChat();
var applozicChat = new ApplozicChat();

Updated 8 months ago

What's Next



NativeScript authentication guide

Suggested Edits are limited on API Reference Pages

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