Manage chat room attributes
Chat rooms enable real-time messaging among multiple users.
This page shows how to use the Chat SDK to manage the attributes of a chat room in your app.
Understand the tech
The Chat SDK provides the ChatManager
and ChatRoom
classes for chat room management, which allows you to implement the following features:
- Update the name of a chat room
- Update the description of a chat room
- Retrieve the announcements of a chat room
- Update the announcements of a chat room
Prerequisites
Before proceeding, ensure that you meet the following requirements:
- You have initialized the Chat SDK. For details, see Get Started with Android.
- You understand the call frequency limit of the Chat APIs supported by different pricing plans as described in Limitations.
- You understand the number of chat rooms supported by different pricing plans as described in Pricing Plan Details.
Implementation
This section introduces how to call the APIs provided by the Chat SDK to implement the features listed above.
Retrieve and modify the chat room attributes
All the chat room members can call fetchChatRoomFromServer
to retrieve the detailed information of the current chat room, including the subject, annoucenments, description, member type, and admin list. The chat room owner and admin can also set and update the chat room information.
Manage chat room announcements
All the chat room members can retrieve the chat room announcements. The chat room owner and admin can set and update the announcements. Once the announcements are updated, all the chat room members receive the onAnnouncementChanged
callback.
Listen for chat room events
For details, see Chat Room Events.