startFaceRecon method
Future<FaceReconReturnValues>
startFaceRecon(
- String environment,
- String clientSessionKey, {
- String? sessionId,
- String? documentNumber,
- String? fontColor,
- String? backgroundColor,
- String? fontFamily,
- bool? showIntroductionScreens,
- bool? showSuccessScreen,
- bool? showInvalidTokenScreen,
- String? audioConfiguration,
- String? onboardingTitle,
- String? onboardingFirstLabel,
- String? onboardingSecondLabel,
- String? onboardingThirdLabel,
- String? logLevel,
override
Implementation
@override
Future<FaceReconReturnValues> startFaceRecon(
String environment,
String clientSessionKey, {
String? sessionId,
String? documentNumber,
String? fontColor,
String? backgroundColor,
String? fontFamily,
bool? showIntroductionScreens,
bool? showSuccessScreen,
bool? showInvalidTokenScreen,
String? audioConfiguration,
String? onboardingTitle,
String? onboardingFirstLabel,
String? onboardingSecondLabel,
String? onboardingThirdLabel,
String? logLevel,
}) async {
try {
final result = await methodChannel.invokeMethod('startFaceRecon', {
'environment': environment,
'clientSessionKey': clientSessionKey,
'sessionId': sessionId,
'documentNumber': documentNumber,
'fontColor': fontColor,
'backgroundColor': backgroundColor,
'fontFamily': fontFamily,
'showIntroductionScreens': showIntroductionScreens,
'showSuccessScreen': showSuccessScreen,
'showInvalidTokenScreen': showInvalidTokenScreen,
'audioConfiguration': audioConfiguration,
'onboardingTitle': onboardingTitle,
'onboardingFirstLabel': onboardingFirstLabel,
'onboardingSecondLabel': onboardingSecondLabel,
'onboardingThirdLabel': onboardingThirdLabel,
'logLevel': logLevel,
});
if (result is Map) {
return FaceReconReturnValues.fromMap(Map<String, dynamic>.from(result));
}
final decoded = jsonDecode(result as String) as Map<String, dynamic>;
return FaceReconReturnValues.fromMap(decoded);
} on PlatformException catch (e) {
final details = e.details as Map<Object?, Object?>?;
throw FaceReconException(
statusCode: details?['status_code'] as int?,
reason: details?['reason'] as String? ?? e.code,
description:
details?['description'] as String? ?? e.message ?? 'Unknown error',
);
}
}