Documentation Index
Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Allow participants to raise their hand to get attention during calls. This feature is useful for large meetings, webinars, or any scenario where participants need to signal they want to speak.
Raise Hand
Signal that you want to speak or get attention:
CallSession.shared.raiseHand()
[[CallSession shared] raiseHand];
Lower Hand
Remove the raised hand indicator:
CallSession.shared.lowerHand()
[[CallSession shared] lowerHand];
Listen for Raise Hand Events
Monitor when participants raise or lower their hands using ParticipantEventListener:
class CallViewController: UIViewController, ParticipantEventListener {
override func viewDidLoad() {
super.viewDidLoad()
CallSession.shared.addParticipantEventListener(self)
}
deinit {
CallSession.shared.removeParticipantEventListener(self)
}
func onParticipantHandRaised(participant: Participant) {
print("\(participant.name ?? "") raised their hand")
// Show notification or visual indicator
showHandRaisedNotification(participant)
}
func onParticipantHandLowered(participant: Participant) {
print("\(participant.name ?? "") lowered their hand")
// Remove notification or visual indicator
hideHandRaisedIndicator(participant)
}
// Other callbacks...
func onParticipantJoined(participant: Participant) {}
func onParticipantLeft(participant: Participant) {}
func onParticipantListChanged(participants: [Participant]) {}
func onParticipantAudioMuted(participant: Participant) {}
func onParticipantAudioUnmuted(participant: Participant) {}
func onParticipantVideoPaused(participant: Participant) {}
func onParticipantVideoResumed(participant: Participant) {}
func onParticipantStartedScreenShare(participant: Participant) {}
func onParticipantStoppedScreenShare(participant: Participant) {}
func onParticipantStartedRecording(participant: Participant) {}
func onParticipantStoppedRecording(participant: Participant) {}
func onDominantSpeakerChanged(participant: Participant) {}
}
@interface CallViewController () <ParticipantEventListener>
@end
@implementation CallViewController
- (void)viewDidLoad {
[super viewDidLoad];
[[CallSession shared] addParticipantEventListener:self];
}
- (void)dealloc {
[[CallSession shared] removeParticipantEventListener:self];
}
- (void)onParticipantHandRaisedWithParticipant:(Participant *)participant {
NSLog(@"%@ raised their hand", participant.name);
// Show notification or visual indicator
[self showHandRaisedNotification:participant];
}
- (void)onParticipantHandLoweredWithParticipant:(Participant *)participant {
NSLog(@"%@ lowered their hand", participant.name);
// Remove notification or visual indicator
[self hideHandRaisedIndicator:participant];
}
// Other callbacks...
@end
Check Raised Hand Status
The Participant object includes a raisedHandTimestamp property to check if a participant has their hand raised:
func onParticipantListChanged(participants: [Participant]) {
let raisedHands = participants
.filter { $0.raisedHandTimestamp > 0 }
.sorted { $0.raisedHandTimestamp < $1.raisedHandTimestamp }
// Display participants with raised hands in order
updateRaisedHandsList(raisedHands)
}
- (void)onParticipantListChangedWithParticipants:(NSArray<Participant *> *)participants {
NSMutableArray *raisedHands = [NSMutableArray array];
for (Participant *p in participants) {
if (p.raisedHandTimestamp > 0) {
[raisedHands addObject:p];
}
}
// Sort by timestamp and display
[raisedHands sortUsingComparator:^NSComparisonResult(Participant *a, Participant *b) {
return [@(a.raisedHandTimestamp) compare:@(b.raisedHandTimestamp)];
}];
[self updateRaisedHandsList:raisedHands];
}
To disable the raise hand feature, hide the button in the call UI:
let sessionSettings = CometChatCalls.sessionSettingsBuilder
.hideRaiseHandButton(true)
.build()
SessionSettings *sessionSettings = [[[CometChatCalls sessionSettingsBuilder]
hideRaiseHandButton:YES]
build];