Add an event handler
Add event handlers for the client app to react to events that occur for the 1-to-1 call. Event handlers can detect device-specific events and call-specific events.
To detect device-specific events, add the
onRinging event handler by registering the
SendbirdCalls.setListener() method. After you’ve added the event handler, an incoming call is handled as shown below.
To detect call-specific events, add the
DirectCallListener event handler by using the
DirectCall.addLitsener() method. To see a full list of call-related events, search
DirectCallListener in the API Reference.
When you want to remove listeners that are no longer in use, call
unsubscribe() when you receive
onEnded or when you perform cleanup for