startSDKWithIdNumber method
Future<BlusaltIdentityResultResponse>
startSDKWithIdNumber(
- BlusaltIdentityType identityType,
- String idNumber
override
Implementation
@override
Future<BlusaltIdentityResultResponse> startSDKWithIdNumber(
BlusaltIdentityType identityType, String idNumber) async {
try {
final result = await methodChannel
.invokeMethod('startIdentityVerificationWithIdNumber', {
'apiKey': _apiKey,
'appName': _appName,
'clientId': _clientID,
'isDev': _isDev,
'documentTypeValue': identityType.value.toLowerCase(),
'idNumber': idNumber,
});
if (result != null) {
return BlusaltIdentityResultResponse.fromJson(json.decode(result),
identityResultType: BlusaltIdentityResultType.success);
} else {
return BlusaltIdentityResultResponse(
identityResultType: BlusaltIdentityResultType.error,
message: "Something went wrong");
}
} on PlatformException catch (exception) {
return BlusaltIdentityResultResponse(
identityResultType: BlusaltIdentityResultType.error,
exception: exception,
message: exception.message);
} catch (e) {
return BlusaltIdentityResultResponse(
identityResultType: BlusaltIdentityResultType.error,
message: e.toString());
}
}