ZegoRangeSceneTeamEventHandler
ZegoRangeSceneTeamEventHandler
Declared in ZegoExpressEventHandler.h
Methods
onTeamStateUpdate:state:errorCode:teamID:
onTeamStateUpdate:state:errorCode:teamID:
- (void)onTeamStateUpdate:(ZegoRangeScene *) rangeScene state:(ZegoTeamState) state errorCode:(int) errorCode teamID:(unsigned int) teamID;The callback triggered when the team connection state changes.
Declared in
ZegoExpressEventHandler.hParameters
| Name | Type | Description |
|---|---|---|
| rangeScene | ZegoRangeScene * | Range scene instance that triggers this callback. |
| state | ZegoTeamState | Changed team state. |
| errorCode | int | Error code, For details, please refer to Common Error Codes. |
| teamID | unsigned int | Team ID. |
Details
This callback is triggered when the connection status of the team changes, and the reason for the change is notified.
- Use cases: Developers can use this callback to determine the status of the current user in the team. When to trigger:
- The developer will receive this notification when calling the [joinTeam], [leaveTeam] functions.
- This notification may also be received when the network condition of the user's device changes (SDK will automatically join the team when reconnected, please refer to [Does ZEGO SDK support a fast reconnection for temporary disconnection] for details](https://docs.zegocloud.com/faq/reconnect?product=ExpressVideo&platform=all).
- Caution: If the connection is being requested for a long time, the general probability is that the user's network is unstable.
- Related APIs: [joinTeam]、[leaveTeam]
- Available since: 3.1.0
- Restrictions: None.
onTeamMemberUpdate:updateType:userList:teamID:
onTeamMemberUpdate:updateType:userList:teamID:
- (void)onTeamMemberUpdate:(ZegoRangeScene *) rangeScene updateType:(ZegoUpdateType) updateType userList:(NSArray<ZegoUser *> *) userList teamID:(unsigned int) teamID;The callback triggered when the number of other users in the team increases or decreases.
Declared in
ZegoExpressEventHandler.hParameters
| Name | Type | Description |
|---|---|---|
| rangeScene | ZegoRangeScene * | Range scene instance that triggers this callback. |
| updateType | ZegoUpdateType | Update type (add/delete). |
| userList | NSArray<ZegoUser *> * | List of users changed in the current team. |
| teamID | unsigned int | Team ID. |
Details
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 join the room for the first time, if there are other users in the team, the SDK will trigger a callback notification with
updateTypebeing [ZegoUpdateTypeAdd], anduserListis the other users in the team at this time. - The user is already in the team. If another user join the team through the [joinTeam] function, the SDK will trigger a callback notification with
updateTypebeing [ZegoUpdateTypeAdd]. - If other users leave the team through the [leaveTeam] function, the SDK will trigger a callback notification with
updateTypebeing [ZegoUpdateTypeDelete].
- When the user join the room for the first time, if there are other users in the team, the SDK will trigger a callback notification with
- Related APIs: [joinTeam]、[leaveTeam]
- Available since: 3.1.0
