onConnectionStateChanged method

FutureOr<void> onConnectionStateChanged(
  1. dynamic state
)
override

@detail callback @author hanchenchen.c @brief Callback SDK and signaling server connection status related events. Callbacks the event when the network connection state of the SDK to the signaling server changes. @param state
The current SDK and signaling server connection status. See ConnectionState{@link #ConnectionState} @param reason
For a detailed definition of the cause of the signaling server connection state change, currently not enabled fixed to -1. @note Refer to Getting Connection Status for more details.

Implementation

FutureOr<void> onConnectionStateChanged(dynamic state) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler)
      .onConnectionStateChanged
      ?.call(int.tryParse(state.toString()) ?? 0, null);
}