onRoomUserUpdate property
void Function(String roomID, ZegoUpdateType updateType, List<ZegoUser> userList)?
onRoomUserUpdate
getter/setter pair
The callback triggered when the number of other users in the room increases or decreases.
Available since: 1.1.0 Description: When other users in the room are online or offline, which causes the user list in the room to change, the developer will be notified through this callback. Use cases: Developers can use this callback to update the user list display in the room in real time. When to trigger:
- When the user logs in to the room for the first time, if there are other users in the room, the SDK will trigger a callback notification with
updateTypebeingZegoUpdateTypeAdd, anduserListis the other users in the room at this time. - The user is already in the room. If another user logs in to the room through the
loginRoomorswitchRoomfunctions, the SDK will trigger a callback notification withupdateTypebeingZegoUpdateTypeAdd. - If other users log out of this room through the
logoutRoomorswitchRoomfunctions, the SDK will trigger a callback notification withupdateTypebeingZegoUpdateTypeDelete. - The user is already in the room. If another user is kicked out of the room from the server, the SDK will trigger a callback notification with
updateTypebeingZegoUpdateTypeDelete. Restrictions: If developers need to use ZEGO room users notifications, please ensure that the ZegoRoomConfig sent by each user when logging in to the room has theisUserStatusNotifyproperty set to true, otherwise the callback notification will not be received. Related APIs:loginRoom、logoutRoom、switchRoom
roomIDRoom ID where the user is logged in, a string of up to 128 bytes in length.updateTypeUpdate type (add/delete).userListList of users changed in the current room.
Implementation
static void Function(
String roomID, ZegoUpdateType updateType, List<ZegoUser> userList)?
onRoomUserUpdate;