startDocAbsentWithCustomSelector method
Future<BlusaltFullIdentityResultResponse?>
startDocAbsentWithCustomSelector({
- required String apiKey,
- required String appName,
- required String clientId,
- required bool isDev,
- required List<
DocumentType> documentTypeList, - String? webhookUrl,
- String? reference,
- bool showLivenessResult = true,
- LivenessFacialComparisonType livenessFacialComparisonType = LivenessFacialComparisonType.motional,
- double? thresholdInPercent,
- int? timeoutDurationInSec,
override
Implementation
@override
Future<BlusaltFullIdentityResultResponse?> startDocAbsentWithCustomSelector({
required String apiKey,
required String appName,
required String clientId,
required bool isDev,
required List<DocumentType> documentTypeList,
String? webhookUrl,
String? reference,
bool showLivenessResult = true,
LivenessFacialComparisonType livenessFacialComparisonType =
LivenessFacialComparisonType.motional,
double? thresholdInPercent,
int? timeoutDurationInSec,
}) async {
try {
if (thresholdInPercent != null &&
(thresholdInPercent < 0 || thresholdInPercent > 100)) {
return BlusaltFullIdentityResultResponse(
blusaltFullIdentityProcess:
BlusaltFullIdentityProcess.notImplemented,
message: "Threshold must be between 0 and 100");
}
final result =
await methodChannel.invokeMethod('startDocAbsentWithCustomSelector', {
'apiKey': apiKey,
'appName': appName,
'clientId': clientId,
'isDev': isDev,
'documentTypeList':
documentTypeList.map((e) => e.name.toUpperCase()).toList(),
'webhookUrl': webhookUrl,
'reference': reference,
'showLivenessResult': showLivenessResult,
'livenessFacialComparisonType':
livenessFacialComparisonType.name.toUpperCase(),
'thresholdInPercent': thresholdInPercent,
'timeoutDurationInSec': timeoutDurationInSec,
});
if (result != null) {
var response = json.decode(result);
return _parseFullIdentityResponse(response, reference);
} else {
return BlusaltFullIdentityResultResponse(
blusaltFullIdentityProcess:
BlusaltFullIdentityProcess.notImplemented,
message: "Something went wrong");
}
} on PlatformException catch (exception) {
return BlusaltFullIdentityResultResponse(
blusaltFullIdentityProcess: BlusaltFullIdentityProcess.notImplemented,
exception: exception,
message: exception.message,
code: exception.code);
} catch (e) {
return BlusaltFullIdentityResultResponse(
blusaltFullIdentityProcess: BlusaltFullIdentityProcess.notImplemented,
message: e.toString());
}
}