Skip to main content
The CometChat Calls SDK uses the addEventListener method to subscribe to call events for the call lifecycle, participants, media state, and real-time updates.

addEventListener

For more granular control, use CometChatCalls.addEventListener() to subscribe to specific events:

Session Status Events

Media Events

Participant Events

Button Click Events

Layout Events

Participant Object

The participant object contains:

Complete Example

Events on a prepared session

CometChatCalls.getActiveSession() returns the session as soon as it is prepared — which is what initiateCall does on the caller and what the Push SDK’s ring does on the callee — before anyone has joined. Listening on it is what lets a caller show “Ringing…” and detect the answer without joining first.
A participant who has only prepared isn’t in the roster. A callee whose device has prepared the session reaches the caller as onParticipantConnected, not onParticipantJoined, and that is the only caller-side signal that the callee’s device has been reached. Participants who have actually joined are reported as usual, including to a session that is still prepared, so handle a callee who is already there.

Incoming call events

On React Native these come from the Push Notifications SDK, not the Calls SDK. They report a call for the logged-in user starting and ending, whether it arrived by push while the app was killed or while it was running.
Each returns an unsubscribe function. Subscribing late is safe: a call answered before your component mounted is held and delivered to the first subscriber. See Ringing.

Login events

CometChatCalls.addLoginListener reports the Calls SDK login state. The Push SDK uses it to keep the identity its ring gates read in step with the logged-in user; your app can use it to gate call UI.
Listener ids are keys: registering the same id twice replaces the earlier listener. Remove it when the screen goes away. The User the Calls SDK hands back is a plain object with a uid field, not a class with getUid().