startDocAbsentWithIdNumber method

  1. @override
Future<BlusaltFullIdentityResultResponse?> startDocAbsentWithIdNumber({
  1. required String apiKey,
  2. required String appName,
  3. required String clientId,
  4. required bool isDev,
  5. required DocumentType documentType,
  6. required String documentNumber,
  7. String? webhookUrl,
  8. String? reference,
  9. bool startProcessOnGettingToFirstScreen = false,
  10. bool showLivenessResult = true,
  11. LivenessFacialComparisonType livenessFacialComparisonType = LivenessFacialComparisonType.dynamic,
  12. ThresholdConfig? thresholdConfig,
  13. int? timeoutDurationInSec,
  14. bool enableEncryption = false,
  15. Map<String, dynamic>? metadata,
})
override

Implementation

@override
Future<BlusaltFullIdentityResultResponse?> startDocAbsentWithIdNumber({
  required String apiKey,
  required String appName,
  required String clientId,
  required bool isDev,
  required DocumentType documentType,
  required String documentNumber,
  String? webhookUrl,
  String? reference,
  bool startProcessOnGettingToFirstScreen = false,
  bool showLivenessResult = true,
  LivenessFacialComparisonType livenessFacialComparisonType =
      LivenessFacialComparisonType.dynamic,
  ThresholdConfig? thresholdConfig,
  int? timeoutDurationInSec,
  bool enableEncryption = false,
  Map<String, dynamic>? metadata,
}) async {
  try {
    final result =
        await methodChannel.invokeMethod('startDocAbsentWithIdNumber', {
      'apiKey': apiKey,
      'appName': appName,
      'clientId': clientId,
      'isDev': isDev,
      'documentType': documentType.name.toUpperCase(),
      'documentNumber': documentNumber,
      'webhookUrl': webhookUrl,
      'reference': reference,
      'startProcessOnGettingToFirstScreen':
          startProcessOnGettingToFirstScreen,
      'showLivenessResult': showLivenessResult,
      'livenessFacialComparisonType':
          livenessFacialComparisonType.name.toUpperCase(),
      'thresholdConfig': thresholdConfig?.toMap(),
      'timeoutDurationInSec': timeoutDurationInSec,
      'enableEncryption': enableEncryption,
      'metadata': metadata,
    });

    if (result != null) {
      final jsonStr = await _readPayload(result);
      var response = json.decode(jsonStr);
      return _parseFullIdentityResponse(response, reference);
    } else {
      return BlusaltFullIdentityResultResponse(
          blusaltFullIdentityProcess:
              BlusaltFullIdentityProcess.notImplemented,
          message: "Something went wrong");
    }
  } on PlatformException catch (exception) {
    // print('PlatformException: ${exception.message}');
    return BlusaltFullIdentityResultResponse(
        blusaltFullIdentityProcess: BlusaltFullIdentityProcess.notImplemented,
        exception: exception,
        message: exception.message,
        code: exception.code);
  } catch (e) {
    // print('exception: ${e.toString()}');
    return BlusaltFullIdentityResultResponse(
        blusaltFullIdentityProcess: BlusaltFullIdentityProcess.notImplemented,
        message: e.toString());
  }
}