registerEventHandler abstract method

void registerEventHandler(
  1. RtcEngineEventHandler eventHandler
)

Adds event handlers

The SDK uses the RtcEngineEventHandler class to send callbacks to the app. The app inherits the methods of this class to receive these callbacks. All methods in this class have default (empty) implementations. Therefore, apps only need to inherits callbacks according to the scenarios. In the callbacks, avoid time-consuming tasks or calling APIs that can block the thread, such as the sendStreamMessage method. Otherwise, the SDK may not work properly.

  • eventHandler Callback events to be added. See RtcEngineEventHandler.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

void registerEventHandler(RtcEngineEventHandler eventHandler);