- Basic Concepts
- Real-Time Messaging
- First App
- Group Messaging
- Reading Messages
- Sync Messages
- Sending Media & Files
- Push Notification
- Voice & Video Calls
- UI Modules
You MUST go through the following prerequisites before you read further.
- Read the First App Guide.
Now let’s quickly start coding:
Before you send and receive real-time messages and calls, you need to initialize Mesibo. The initialization involves the following steps:
- Set your user credentials for authentication: access token using
setCredentialsand app ID using
- Set up Mesibo to invoke your listener class using
- Set up database to store sent and received messages using
- Start Mesibo
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 the 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 a 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 the
Editbutton. Scroll down, you will see a section to
- Enter 1000 (or anything) in the
Create This Usercheckbox, type message and click on
- You will instantly receive this message in your mobile app in
In the previous section, we have used mesibo console to send a message. Now we will quickly learn how to send messages from the app itself. To send messages, we will use
sendMessage real-time API for which we will need destination user, message-id, and the message itself.
Invoke the following function anywhere from your code to send a text message. In a 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 messages to each other by using the above function.
Download Sample Application
You can download the following sample applications to learn more:mesibo, android, ios