setAudioMode method

  1. @override
void setAudioMode(
  1. String setAudioMode,
  2. dynamic onSuccess(
    1. String success
    ),
  3. dynamic onError(
    1. CometChatCallsException e
    )
)
override

Implementation

@override
void setAudioMode(String setAudioMode, onSuccess, onError) async {
  try {
    final result = await methodChannel.invokeMethod<String>('setAudioMode', {
      "value": setAudioMode,
    });
    onSuccess(result ?? "success");
  } on PlatformException catch (platformException) {
    onError(CometChatCallsException(platformException.code,
        platformException.message, platformException.details));
  } catch (e) {
    onError(CometChatCallsException(
        CometChatCallsConstants.codeError, e.toString(), e.toString()));
  }
}