Overview of Message Extensions for One-to-One and Group Chat
The message extension feature for one-to-one and group chat allows you to add status identifiers (extension data in key-value pairs) to original messages, providing interfaces for adding, deleting, and querying extension information.
Use Cases
Message extensions can be used in business scenarios where status identifiers need to be added to original messages in one-to-one or group chat conversations. Here are some examples:
- Message Comments: You can add comments by setting extension information for the original message.
- Gift Redemption or Order Status Changes: This feature can be used to change the display status of a message. For example, when sending a gift to a user, the default status is "unclaimed," and after the user clicks, the message extension can be set to "claimed."
The message extension interfaces for one-to-one and group chat only support one-to-one and group chat conversation types.
- Chatroom scenarios do not support message extensions. You cannot use message extensions in chatrooms.
Long-Term Storage of Message Extension Data
Message extension operations are implemented through a special type of message, which can be considered as an "extension operation message." To ensure that extension operation messages can still be retrieved in cases such as long-term client inactivity, it is recommended to enable the Cloud Storage for One-to-One and Group Messages feature on the Chat pricing plans page.
The Cloud Storage for One-to-One and Group Messages feature ensures that senders can retrieve historical messages (including extension operation messages) even if they have not logged into the client for a long time or if messages are not stored locally.
- Without this feature enabled, the IM server defaults to saving offline messages for 7 days, which can be retrieved by the client upon reconnection. For example, if the original message is stored locally and multiple extension operations have been performed during the offline period, the client can retrieve extension operation messages within the last 7 days upon reconnection. Note, however, that the client cannot retrieve extension operation messages older than 7 days.
- With this feature enabled, messages are stored in the server's historical message database, with a default retention period of 6 months. Messages that have not been retrieved for a long time or have been deleted locally can be retrieved through the client SDK's interface for pulling historical messages from the server.
To enable Cloud Storage for One-to-One and Group Messages, visit the Console. In a production environment, this service can be enabled for Chat Premium Plan or Chat Ultimate Plan users. For specific features and pricing, please refer to the Billing Documentation.