getCallState static method

Future<String> getCallState({
  1. required String? sessionId,
})

Get the current call state

Other platforms than Android and iOS will receive CallState.UNKNOWN

Implementation

static Future<String> getCallState({
  required String? sessionId,
}) async {
  if (!Platform.isAndroid && !Platform.isIOS)
    return Future.value(CallState.UNKNOWN);

  return _methodChannel.invokeMethod("getCallState", {
    'session_id': sessionId,
  }).then((state) {
    return state.toString();
  });
}