addConnectionEventHandler method

void addConnectionEventHandler(
  1. String identifier,
  2. EMConnectionEventHandler handler
)

~english Adds the connection event handler. After calling this method, you can handle new connection events when they arrive.

Param identifier The custom handler identifier, which is used to find the corresponding handler.

Param handler The handler for connection event. See EMConnectionEventHandler. ~end

~chinese 添加连接状态监听事件。

Param identifier 监听事件对应 ID。

Param handler 监听的事件。 请见 EMConnectionEventHandler。 ~end

Implementation

void addConnectionEventHandler(
  String identifier,
  EMConnectionEventHandler handler,
) {
  _connectionEventHandler[identifier] = handler;
}