liveness method

Future<void> liveness({
  1. dynamic onLiveness(
    1. dynamic
    )?,
})

Initiates the liveness detection activity.

This method triggers the liveness detection process by invoking the 'livenessDetectActivity' method on the method channel. It also sets up a callback for handling the liveness detection result.

The onLiveness callback is optional and will be called with the result of the liveness detection.

Parameters:

  • onLiveness: A callback function that takes a dynamic parameter. This callback will be invoked with the result of the liveness detection.

Implementation

Future<void> liveness({
  Function(dynamic)? onLiveness,
}) async {
  registerCallback("onLiveness", onLiveness ?? (_) {});
  await methodChannel.invokeMethod('livenessDetectActivity', {
    'identifyCallBackId': 0,
  });
}