startFaceRecon method

  1. @override
Future<String?> startFaceRecon(
  1. String clientSessionKey,
  2. String sessionId,
  3. String fontColor,
  4. String backgroundColor,
  5. String environment,
  6. String audioConfiguration,
  7. bool showSuccessScreen,
  8. bool showInvalidTokenScreen,
  9. bool showIntroductionScreens,
  10. bool activeFaceLiveness,
  11. bool useValidation,
  12. String documentNumber,
)
override

Implementation

@override
Future<String?> startFaceRecon(
  String clientSessionKey,
  String sessionId,
  String fontColor,
  String backgroundColor,
  String environment,
  String audioConfiguration,
  bool showSuccessScreen,
  bool showInvalidTokenScreen,
  bool showIntroductionScreens,
  bool activeFaceLiveness,
  bool useValidation,
  String documentNumber,
) async {
  try {
    return await methodChannel.invokeMethod('startFaceRecon', {
      'clientSessionKey': clientSessionKey,
      'sessionId': sessionId,
      'fontColor': fontColor,
      'backgroundColor': backgroundColor,
      'environment': environment,
      'audioConfiguration': audioConfiguration,
      'showSuccessScreen': showSuccessScreen,
      'showInvalidTokenScreen': showInvalidTokenScreen,
      'showIntroductionScreens': showIntroductionScreens,
      'activeFaceLiveness': activeFaceLiveness,
      'useValidation': useValidation,
      'documentNumber': documentNumber,
    });
  } on PlatformException catch (e) {
    final details = e.details as Map<Object?, Object?>?;

    final statusCode = details?['status_code'] as int?;
    final reason = details?['reason'] as String? ?? e.code;
    final description = details?['description'] as String? ?? e.message ?? 'Unknown error';

    throw FaceReconException(
      statusCode: statusCode,
      reason: reason,
      description: description
    );
  }
}