Getting Started Guide

Users and Groups

Before driving into messaging, calls, and other aspects, let's first understand the concept of end-points or destinations.

For instance, when you send an SMS, the destination is a phone number. When sending an email, the destination is an email address. Similarly, in mesibo, the address (previously used for creating tokens) serves as the destination for one-to-one messages or calls. As mentioned earlier, the address could be any string, as defined by your application. In your application, a user is identified by their address.

A group is a set of users. When you create a group in mesibo (explained later), a group ID will be assigned to that group.

mesibo represents each user and group through the MesiboProfile object. This object encompasses all information about the user or group, such as name, status, photo, etc. Once you have the profile, you can execute various APIs, including accessing profile information, sending messages to the destination, etc.

You can read more about profiles here.

Getting User or a Group Profile

You can get the profile of any user or a group using getProfile API.

profile = Mesibo.getProfile("address"); // get user profile

name = profile.getName();
image = profile.getImage().getImage();
imagePath = profile.getImage().getImagePath();

Or

profile = Mesibo.getProfile(groupId); // get group profile

name = profile.getName();
image = profile.getImage().getImage();
imagePath = profile.getImage().getImagePath();

If mesibo has the profile, it returns immediately. If not, mesibo returns you an empty profile and then checks the server for the profile. If it finds it on the server, it syncs and then invokes Mesibo_onProfileUpdate. It is recommended that you read users and profiles documentation for details.

Setting Profile Information

Your users can set profile information which other users can view. The mesibo will automatically sync the profile information to other users. To set profile information, you can use selfProfile object.

MesiboSelfProfile selfProfile = Mesibo.getSelfProfile();

selfProfile.setName("John Doe");
selfProfile.setString("status", "Hey! I am using this app.");
selfProfile.setString("city", "Palo Alto");
selfProfile.setInt("zipCode", 94301);
selfProfile.setImage(bitmap);
selfProfile.save(); // publish 

A user can not modify profile of other users. Any set operation on other users profile will only reflect locally.

In the next section, we will learn how to use profile objects to send one-to-one and group messages.