Skip to main content
Version: 2.0.x

Remove Participant - iOS

Remove participant allows removing participant while session is on-going. This can be helpful when moderation in particular meeting is required.

let participant = meeting?.participants.first(where: { $0.id == <participantId> })

// Remove participant from active session
// This will emit an event called "onParticipantLeft" to that particular participant
participant?.remove()

Events

onParticipantLeft - Removing participant will trigger onParticipantLeft event.

// MARK: - MeetingEventListener

extension MeetingViewController: MeetingEventListener {

/// A participant left from the meeting
/// - Parameter participant: participant object
func onParticipantLeft(_ participant: Participant) {
// remove listener
participant.removeEventListener(self)

// remove from list and update ui
guard let index = self.participants.firstIndex(where: { $0.id == participant.id }) else {
return
}

// remove participant from list
participants.remove(at: index)

// hide from ui
// ex. remove from collectionview
// removeParticipantFromGridView(at: index)
}
}

API Reference

The API references for all the methods and events utilised in this guide are provided below.

Got a Question? Ask us on discord


Was this helpful?