Frequently Asked Questions - Messaging

Estimated reading time: 3 minutes

Messaging

How to send a message?

To send a message, just create an instance of MessageParams, populate with id and message and use sendMessage function to send it to a user or a group. That’s it. Mesibo takes care of everything including connection handling, retries, error handling, flow control etc. Mesibo delivers messages instantly if the destination user is online. If not, messages will be delivered as soon as destination user is online. This is automatic and transparent to applications, so applications sending messages need not to worry if the receiving applications are up and running. Conversely, receiving applications need not worry about the status of the sending application. Refer Basic concepts and client side API reference section in documentation for details.

How do I get the status of a message I sent?

Mesibo informs you in real-time about the status of every message in Mesibo_onMessageStatus callback. Refer client-side API reference for details.

What happens when I send messages to a user who is not online?

Mesibo uses cut-through switching to deliver your messages in real-time with minimum latency. However, if the destination is not online, Mesibo stores the messages until the user is online. If you decide not to save messages in the database, you can do so by setting a flag while sending messages using real-time API.

What is the retention period of messages stored in the database?

Mesibo offers unlimited message retention period, only limited by the storage quota and usage. You can anytime clear storage from the mesibo console or using server-side API.

Does Mesibo supports typing indication?

Yes. Also, not only typing indications, Mesibo allows you to create, send and receive an unlimited number of activities in 1:1 and group messaging, for example, typing, online, left, joined, etc or any custom activities specific to your app, like shooting, tapping in a game etc. Refer client side API reference for details.

How do I know Online/Offline Status of a user?

The short answer is, each user has lastActiveTime. You can use it to determine if that user is Online or Offline. You can also use webhook to get an instant notification every time when the user is Online OR Offline.

However, the interpretation of Online and Offline status varies from an app to app. For some apps, it’s just the connection status, and for other apps, user is considered online when actively using the app while being connected. Hence, Online and Offline status requires a bit of elaboration.

In past, apps could stay online even when running in background. However, it’s no longer a case. Both Android and iOS will suspend the app after app moves to backgroup. Read more about Android and iOS backgroup execution limits here and here.

So technically speaking, most users are offline unless they are actively using the app. When you send a message, a push notification will wake them up, and the app will be online. This still does not mean that the user is actively using the app since the message was delivered when the app was in background. So if your app only considers the connection status as Online status, the above answer will suffice. However, if you like to extend your app to know active status, you can send an Online Actity (see the previous question) which remote app can decide to answer based on their `Online’ status. This is more effective but has privacy implications. Hence, based on your app policy, mesibo let you choose the implementation.

get started, setup, orientation, mesibo, chat, GDPR