liveness method
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,
});
}