createSoundMessage method

  1. @override
Future<V2TimMsgCreateInfoResult?> createSoundMessage({
  1. required String soundPath,
  2. required int duration,
})
override

Implementation

@override
Future<V2TimMsgCreateInfoResult?> createSoundMessage({
  required String soundPath,
  required int duration,
}) async {
  final res = await TencentImSDKPlugin.v2TIMManager
      .getMessageManager()
      .createSoundMessage(soundPath: soundPath, duration: duration);
  if (res.code == 0) {
    return res.data;
  }
  _coreService.callOnCallback(TIMCallback(
      type: TIMCallbackType.API_ERROR,
      errorMsg: res.desc,
      errorCode: res.code));
  return null;
}