startFullIdentitySDK method

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

Implementation

@override
Future<BlusaltFullIdentityResultResponse?> startFullIdentitySDK({
  required String apiKey,
  required String appName,
  required String clientId,
  required bool isDev,
  String? webhookUrl,
  String? reference,
  LivenessFacialComparisonType livenessFacialComparisonType =
      LivenessFacialComparisonType.dynamic,
  bool showLivenessResult = true,
  List<DocumentType>? documentTypeList,
  ThresholdConfig? thresholdConfig,
  int? timeoutDurationInSec,
  bool enableEncryption = false,
  Map<String, dynamic>? metadata,
}) async {
  try {
    final result = await methodChannel.invokeMethod('startFullIdentitySDK', {
      'apiKey': apiKey,
      'appName': appName,
      'clientId': clientId,
      'isDev': isDev,
      'webhookUrl': webhookUrl,
      'reference': reference,
      'showLivenessResult': showLivenessResult,
      'livenessFacialComparisonType':
          livenessFacialComparisonType.name.toUpperCase(),
      'documentTypeList':
          documentTypeList?.map((e) => e.name.toUpperCase()).toList(),
      '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) {
    return BlusaltFullIdentityResultResponse(
        blusaltFullIdentityProcess: BlusaltFullIdentityProcess.notImplemented,
        exception: exception,
        message: exception.message ?? '',
        code: exception.code);
  } catch (e) {
    return BlusaltFullIdentityResultResponse(
        blusaltFullIdentityProcess: BlusaltFullIdentityProcess.notImplemented,
        message: e.toString());
  }
}