applySingleCallAcceptSuccess static method

Future<void> applySingleCallAcceptSuccess({
  1. required CallKitRuntimeAdapter runtimeAdapter,
  2. required CallState callState,
  3. required VoidCallback syncCallStateToNative,
  4. NECallInfo? callInfo,
})

Implementation

static Future<void> applySingleCallAcceptSuccess({
  required CallKitRuntimeAdapter runtimeAdapter,
  required CallState callState,
  required VoidCallback syncCallStateToNative,
  NECallInfo? callInfo,
}) async {
  final callId = callInfo?.callId;
  if (callId != null && callId.isNotEmpty) {
    callState.currentCallId = callId;
  }
  // 被叫本端接听成功后即应停铃,不能依赖远端连通事件兜底。
  await runtimeAdapter.stopRing();
  callState.selfUser.callStatus = NECallStatus.accept;
  syncCallStateToNative();
}