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. bool showLivenessResult = true,
  8. List<DocumentType>? documentTypeList,
  9. int? timeoutDurationInSec,
})
override

Implementation

@override
Future<BlusaltFullIdentityResultResponse?> startFullIdentitySDK({
  required String apiKey,
  required String appName,
  required String clientId,
  required bool isDev,
  String? webhookUrl,
  String? reference,
  bool showLivenessResult = true,
  List<DocumentType>? documentTypeList,
  int? timeoutDurationInSec,
}) async {
  try {
    final result = await methodChannel.invokeMethod('startFullIdentitySDK', {
      'apiKey': apiKey,
      'appName': appName,
      'clientId': clientId,
      'isDev': isDev,
      'webhookUrl': webhookUrl,
      'reference': reference,
      'showLivenessResult': showLivenessResult,
      'documentTypeList':
          documentTypeList?.map((e) => e.name.toUpperCase()).toList(),
      '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());
  }
}