Creating Messages

All message sending methods are designed to be robust enough to work under any network conditions. When you send any message, that message will automatically be put into a queue incase of any unforeseen unstable network conditions. Once the SDK reconnects to the server, it will automatically resend all the queued messages.

Additionally, sent messages are always returned in message queries, even before they have been delivered to the server. This provides the user with a fluid messaging flow: when a user sends a message, that sent message will appear in the message stream right away (instead of waiting until it has been confirmed by the server). To check or display the current status of message delivery for your application, use the syncState property in the message model; for web you should useMessage.getState() method in the Message object.

There are four statuses of syncState:

  1. default - idle state, message is created and stored locally (on client device)

  2. syncing - message is currently syncing to the server

  3. synced - message is synced and stored on both client and server

  4. error - failed to sync message

Amity supports the sending and receiving of these types of messages

Last updated