Write your First mesibo Enabled ApplicationEstimated reading time: 3 minutes
- File Transfer
- UI Modules
- Voice and Video Calls
You MUST go through following prerequisites before you read further.
- Read the Preparation Guide.
Now let’s quickly start coding:
Now, initialize mesibo like shown below
Implement MesiboListener to receive messages and status in real-time.
That’s it - you are now ready to receive your first real-time message.
Testing your first application
- Compile and Run Application.
Mesibo_onConnectionStatusshould cycle through various status information. Finally, you should receive
status=1which indicates that your app is successfully connected to mesibo real-time server and ready to send and receive real-time messages.
- Since we do not have any other users right now, we will use mesibo console to send a test message. In later section, we will learn how to send messages from the app itself.
- Go to Console ->Application->Users. You should see the user you have created.
- Go to user details by clicking
Editbutton. Scroll down, you will see a section to
- Enter 1000 (or anything) in
Create This Usercheckbox, type message and click on
- You will instantly receive this message in your mobile app in
In previous section, we have used mesibo console to send a message. Now we will quickly learn how to send messages from app itself. To send messages, we will use
sendMessage real-time API for which we will need destination user, message id and message itself.
Invoke following function anywhere from your code to send a text message. In later section, we will learn how to send rich messages.
That’s it! Try it out by creating two instances of the app and send message to each other by using above function.
Download Sample Application
You can download entire sample application from GitHubmesibo, android, ios