Write your First mesibo Enabled Application

Excited to see real-time messaging in action? We are too..

First Step

Before we start coding our first Android, iOS or web application - we need to perform a few steps that are common across platforms. You can perform these steps using mesibo server-side API or mesibo console.

Let’s say you are creating a new app ‘BingoMessage’ for Android, iOS and web.

  1. Add a new Application ‘BingoMessage’ using mesibo console (or using mesibo server-side API).
  2. Create users for this application using console or server-side api. You may use console to create a small number of users; however this job is best handled by using server-side API. An access token is generated for each user that will be passed to client-side API to create real-time connection.
  3. [Optional] Create groups, using console or server-side api.
  4. That’s it - now users can start communicating with each other in real-time using mesibo’s real-time client side API for Android, ios or web.

Isn’t it simple? So let’s quickly move to create our first application.

Make Note of your API Key & Application Token

You can view your API key and Application token in the console. Note this as you will need it in next steps.
In this example,

API Key: k6ci4gmdbwfnxf0j9ai8e3o2zj7cxusiebamn7oqcyfr3yx9ng13pn3ihqdnyn54


Create Your Application

Create an Application that will hold all your users and groups. You can create an Application (Apps->New App) from the console OR you can use API key and invoking server-side API, for example,

New Application Request


The above API returns JSON response like this,



As you can see from the response that the application has been successfully created and the application token is


We can use this application token to create users and groups for this application.

hand-pointing-to-right-direction You can also create an application from the console by clicking on ‘New Application’ button from the dashboard.

Create Users (Endpoints)

Once you have created your Application, it’s time to add users and groups. Typically, you will add users and groups dynamically on need basis. However, for this sample app, you can create a few users and groups manually so that you can test messaging between them.

Let’s say we are creating a user 18005550001 which should be used on Android or iOS app having app id (bundle id in iOS) - com.mesibo.demoapp. We will be using app token obtained in the previous step.

User Creation Request


appid = Android or iOS app id (for example, com.mesibo.xxx). In case of web, just pass, ‘web’ as appid. Note that, for security reasons, the token generated for a particular appid will only be usable on app matching that appid.
addr = end point address, for example, a user phone number.

You can find more about server-side API in the reference section. The above API returns JSON response like this,



The above API returns JSON response with access token, that will be used by Android, iOS and web application to connect to mesibo real-time server (using setAccessToken API).

You can now create more users in similar fashion so that you test messaging between them. You can also send messages to a particular user from console from ‘Users’ section.

hand-pointing-to-right-direction You can also create users from the console by clicking on ‘New User’ button from the Application settings page.

We are now all set to create our first mobile app.

Which mobile app platform would you like to get started with?

Create a Basic Application

Once we created an Application and Users as described in the previous section, we are now ready to write code for a basic application which can send and receive real-time messages.

Follow these steps to create a new project from scratch. If you already have an application, you can skip those steps. You can also download the sample app project from GitHub


We are uploading soon...Meanwhile contact us at- support@mesibo.com


  1. Start Android Studio.
  2. Create a new project with minimum SDK version 9 or higher (14 recommended).
  3. Android Studio starts Gradle and builds your project. This may take a few seconds. For more information about creating a project in Android Studio, see the Android Studio documentation. https://developer.android.com/training/basics/firstapp/creating-project.html
  4. Add mesibo SDK to your project by adding gradle dependency and performing gradle sync as explained in installation instructions.
  5. Add mesibo initialization code in your onCreate method
  6. 								import com.mesibo.api.mesibo;

    						protected void onCreate(Bundle savedInstanceState) {
    							mesibo api = mesibo.getInstance();
    							// set user authentication token obtained by creating user

  7. Extend your activity to Implement mesibo.MessageListener and mesibo.ConnectionListner class
  8. 				public class MainActivity extends AppCompatActivity implements mesibo.MessageListener {

    Easiest way is to click on the menu, Code->Implement Methods and it will automatically generates the code for all the methods.

  9. That’s it - you are now ready to receive your first real-time message


  1. Start xCode.
  2. Create a new project.
  3. Add mesibo SDK to your project now by adding gradle dependency and perform gradle sync as explained in installation instructions.
  4. Drag mesibo.framework to your xcode project. xCode will prompt you for various options - make sure to select "Copy items if needed."
  5. #import < mesibo/mesibo.h > in your project
  6. Add mesibo initialization code in your onCreate method

Testing your first application

  1. Most simple way to test your code is to go to Console ->Application->Users. Select user, type from and message and click on ‘Send Message’.
  2. You can also use two instance of app with different auth token and use mesibo.sendMessage function to send messages between both of them.

Download sample application from GitHub

Use mesibo User Interface (UI) Components

mesibo UI components let you add beautiful messaging user interface in no-time.

  1. Initialize mesibo and set auth token as we did in the Basic Application
  2. Launch UI module by calling
    					mesiboUI.launch(context, 0, false, true);
  3. If you plan to use location feature, add google map API key in the manifest
  4. That’s it.

hand-pointing-to-right-direction Refer to sample app code sample for ready-to-run examples.

How to add file handling

Sending files is not much different than sending plain messages. All you need to do is to first upload the file to a server and then send the URL and thumbnail [optional] using mesibo in real-time. The receiver then downloads it using that URL.

mesibo offers you the flexibility to store all files on your own servers, including private servers or cloud services like Amazon Web Services, Google Cloud Storage, Microsoft Azure etc.

mesibo provides a convenient utility function sendFile, which does most of the job and allows you send various other information along with the file such as title, message, geolocation, etc. Receiver is notified of incoming file in listener function mesibo_onFile()

Note that, you must implement upload and download handler functions in mesiboFileTransferHandler in order to enable sending and receiving files. For more information, refer to FileTransferHandle reference document.

hand-pointing-to-right-direction Refer to FileTransferHandler.java (Android) or FileTransfer.m (iOS) to learn how to create a file handler.