Calls / Unity
Calls Unity v1
Calls Unity
Calls
Unity
Home
/
Calls
/
Unity
/
Event listener

Manage an event listener

You can manage an event listener by adding or removing it from a room. When an event listener is added to a room, a user can receive events for actions taken in the room they are currently participating in.


Add an event listener

You can add an event listener for users to receive events that occur in the room.

room.AddEventListener(new MyRoomListener());

class MyRoomListener : SbRoomEventListener { }

Remove an event listener

You can remove the registered event listeners using the following code to stop receiving events about a room.

// Removes a specific listener.
room.RemoveEventListener(myRoomListener);

// Removes all listeners.
room.RemoveAllEventListeners();