Basic Message Features

Update time: 2021/08/22 17:50:30

Message type

Messages in IM SDK include in-session messages and system notification messages.

In-session message

In-session messages are only found and displayed in the chat interface, which is generally sent by a user in the app to another user (or team/chat room), such as text and picture messages. In-session messages supported by IM SDK currently include:

In-session message type Remark
Text message A text message includes ordinary text.
Picture message An image message includes such information as image URL, dimension, and size.
Voice message A voice message includes such information as the URL, duration, size, and format of any voice file.
Video message A video message includes such information as the URL, duration, size, and format of any video file.
File message A video message includes such information as the URL, duration, size, and format of any video file.
Location message A location message includes such information as location title, longitude, and latitude.
Team event notification message This is a notification of team events, which is issued by the server. No team event notification message can be sent by the client. Notification messages include online, offline and roaming mechanism, without notification bar.
Tip message Without push notification or notification bar, the tip message is mainly used as a notification in sessions, such as a welcome message when ready for a session, or any tip message after sensitive words appear in the session.
Custom message This is a message customized by the developer, such as red packet message, and rock-paper-scissors message.

System notification message

A system notification message is a type of system-level messages, which is generally sent by the system to a user or a team. System notification messages include built-in and custom ones.

  • Built-in system notification is a notification pre-defined by SDK, which is sent by ConnectEase server to users for event notification of ConnectEase system. Built-in system notifications currently include the notifications related to team change, such as application for joining a team, and team invitation. If the third-party app also hosts friendship, addition and removal of friends are also included into this type of notification. System notifications are received and stored by SDK that supports simple management of unread count. Only online and offline messages are available, and neither roaming nor push notifications are provided.
  • Custom system notifications refer to some notifications of event status defined by the developer, and can be sent by both the client and the server. Without storing or parsing the notifications, SDK is only used to transmit and notify such events on behalf of a third party to achieve pass-through purposes, and the upper layer developer is responsible for the persistent work after custom notification.
Type Message storage Unread count Offline message Roaming message Push notification
Built-in system notification Yes Yes Yes No No
Custom system notification No No Yes No Yes

For the platform development guide for system notification messages, please refer to:

Concepts of easily confused messages

Notification message and system notification

  • Concept

Notification messages are messages in sessions (Within the session), including online, offline and roaming messages. Such messages are currently used for notification of team events (already completed), and are not included in the unread count. Neither push notification nor notification bar is available.

System notifications are built in by ConnectEase, which are sent by ConnectEase server to users for notification of ConnectEase system events. System notifications mainly include team change notifications, such as application for joining a team and team invitation. If the third-party app also hosts friendship, addition and removal of friends are also included into this type of notification. System notifications are received and stored by SDK that supports simple management of unread count. Only online and offline notifications are available, and no roaming notifications are provided. Neither push notification nor notification bar is available (if required, custom system notifications are sent).

  • Application scene

Notification messages are generally in the middle of the chat interface. For example, a team name has been updated; XXX quited the team chat, etc.

System notifications are generally displayed in the list of verification messages. For example, xxx requested you as a friend, etc.

Custom message and custom system notification

  • Concept

Custom messages are in-session messages mainly provided to third-party developers for customizing messages, including online, offline and roaming messages, as well as tips in a notification bar. Global messages defined by a third party only include online and offline messages instead of roaming ones.

The difference between custom notifications and custom messages is that the latter is a part of the in-session message system, stored by SDK in the message database, and displayed to users together with other built-in messages of ConnectEase. Custom notifications are mainly used for notification of third-party event status. Without storing or parsing the notifications, ConnectEase is only used to store and notify such events on behalf of a third party to achieve pass-through purposes.

  • Application scene

Generally similar to ordinary texts and voice messages, custom messages are at the left and right of the chat interface. For example, finger-guessing game, stickers and burn after reading may be realized by sending custom messages.

Typically, in relation to custom system notifications, "Typing" will be displayed when both sides are in the P2P chat interface.

Features of message

In addition to abundant message types, IM SDK also makes available common message features to the developer.

Features of message Description
Offline message Messages sent by others when offline. At the next login, offline messages temporarily stored offline will be automatically sent to the client SDK. In a P2P scene, 5,000 latest offline messages within the recent 30 days will be sent, and each session contains up to 100 latest offline messages; in the team chat scene, offline messages within the recent 30 days will be sent, and each team chat session contains up to 100 latest offline messages.
Roaming message At login on a new device (or uninstalled and reinstalled), the roaming messages recorded in the server will be auto-synced to the client SDK. Roam the recent 100 sessions within 7 days, and the recent 100 messages in each session
multi-terminal sync If an account is online at several client terminals, the messages sent from a terminal will be synced to other terminals in real time.
Message history Local message history and cloud message history are supported. The standard IM may get the cloud message history for the recent one year, which can be extended to 3 years at most (value-added feature).
Recall message A successfully delivered message may be recalled within 2 minutes by default. The duration when a message can be recalled may be configured in the user console. The recall operation only applies to single chat and team chat messages, instead of chat room messages.
Read receipt View the read and unread status of the other in P2P or team chat sessions.
Forward message Messages are forwarded to other users or teams.
@某人 Message extension field is used for realization. To mention somebody when sending a team message, a team message may be sent with the mentioned account list via an extension field; upon receipt of the team message, team members may check whether they are in the mentioned account list; if yes, they will receive a tip "you were mentioned" on the interface.
Typing Refer to Send custom system notifications for custom system notifications.

Recent session

Recent session, known as the recent contact list, records the information of contact who recently had a session with the users, including the account and type of contact, time of recent message, message status, content, and unread count.

In relation to the recent session list, SDK maintains and provides the interface for querying and monitoring changes. As long as there is any chat with a user or team ( sends or receives messages), SDK will automatically update the recent session list and notify the upper level, and the developer is not required to manually update the session list.

In some cases, the developer might manually insert a session (i.e. a recent contact) in the recent session list. For example, after creating an advanced team, it is required to display the team sessions in the recent session list. No messages will be received when an advanced team has been created. SDK will not immediately update recent sessions. To satisfy the demands, a local message may be inserted in the callback of successful creation of team to insert a session.

Particularly, recent sessions are local, and will not roam. After login on a new device, the recent session list will be automatically generated according to the current roaming and offline messages.

Was this page helpful?
Yes
No
  • Message type
  • In-session message
  • System notification message
  • Concepts of easily confused messages
  • Notification message and system notification
  • Custom message and custom system notification
  • Features of message
  • Recent session