call method

  1. @override
Future<TUIResult> call(
  1. String userId,
  2. TUICallMediaType mediaType,
  3. TUICallParams params
)
override

Implementation

@override
Future<TUIResult> call(String userId, TUICallMediaType mediaType, TUICallParams params) async {
  try {
    if (!kIsWeb && (Platform.isIOS || Platform.isAndroid)) {
      await methodChannel
          .invokeMethod(
          "call", {'userId': userId, 'mediaType': mediaType.index, 'params': params.toJson()});
    } else {
      return TUIResult(code: "-1", message: 'This platform is not supported');
    }
  } on PlatformException catch (error) {
    return TUIResult(code: error.code, message: error.message);
  } on Exception catch (error) {
    return TUIResult(code: "-1", message: error.toString());
  }
  return TUIResult(code: "", message: "call success");
}