uqudosdk-react-native 3.4.2 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/android/build.gradle +2 -1
- package/android/src/main/java/io/sdk/uqudoid/UqudoIdModule.java +202 -1
- package/index.js +1 -1
- package/ios/UqudoId.m +331 -97
- package/package.json +1 -1
- package/uqudoBuilder/uqudo.js +155 -4
- package/uqudosdk-react-native.podspec +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
|
+
## 3.5.1
|
|
2
|
+
|
|
3
|
+
* Patch Release:
|
|
4
|
+
- Resolved compile issues discovered after the 3.5.0 release.
|
|
5
|
+
|
|
6
|
+
## 3.5.0
|
|
7
|
+
|
|
8
|
+
* New Document Support:
|
|
9
|
+
- Added support for Indonesian ID and Iraqi Resident ID documents.
|
|
10
|
+
* Document Classification Improvements:
|
|
11
|
+
- Enhanced classification for Qatari ID. Previously, low scores on the back side could cause rejections during scanning; this issue has been addressed.
|
|
12
|
+
* Android SDK:
|
|
13
|
+
- Upgraded CameraX library to version 1.4.2.
|
|
14
|
+
- Fixed a potential crash during NFC reading of Emirates ID if the user removed the phone at a critical point in the final reading step.
|
|
15
|
+
* iOS SDK:
|
|
16
|
+
- Updated the OpenSSL dependency to version 3.3.3001 for NFC reading functionality. Using version 1.x will cause the SDK to crash.
|
|
17
|
+
- Fixed a rare crash related to camera selection. If the camera is unavailable, the SDK now safely ends the session with status code `SESSION_INVALIDATED_CAMERA_NOT_AVAILABLE`.
|
|
18
|
+
- Removed legacy `assets.bundle` and optimized existing assets, reducing total asset size by about 2MB.
|
|
19
|
+
* NFC / Chip Reading Enhancements:
|
|
20
|
+
- Improved support for EAC-CA (Chip Authentication), especially for passports. The SDK now handles defective chip implementations more gracefully by ignoring chip authentication failures. You can check if chip authentication was enabled in the verification object.
|
|
21
|
+
* Facial Liveness – New Active Liveness Feature:
|
|
22
|
+
- Introduced a new active liveness option in the facial recognition configuration. The SDK randomly prompts the user to perform one of six actions: move closer, move further, tilt right, tilt left, turn right, or turn left. You can disable one gesture type (move, tilt, or turn) to reduce the pool to four actions.
|
|
23
|
+
- ⚠️ Important: Enable this feature only if required by compliance, as it may reduce conversion rates. See the documentation for configuration details.
|
|
24
|
+
* New NFC/Reading Flow:
|
|
25
|
+
- Added a dedicated NFC/Reading flow, allowing verification processes to begin from the NFC step. You must supply required data to unlock the chip. Refer to the documentation for full details.
|
|
26
|
+
* General:
|
|
27
|
+
- Minor bug fixes and performance improvements.
|
|
28
|
+
|
|
1
29
|
## 3.4.2
|
|
30
|
+
|
|
2
31
|
* New Feature
|
|
3
32
|
- Facial recognition is now supported when using the MRZ document type in combination with NFC. Previously, facial recognition was disabled with MRZ as it only involved scanning the machine-readable zone (MRZ) of the document. From this version onward, facial recognition can be enabled and if there is a successful NFC reading during onboarding, the user will proceed to the facial recognition step, otherwise the step is automatically skipped.
|
|
4
33
|
* Document Scanning
|
package/android/build.gradle
CHANGED
|
@@ -20,6 +20,7 @@ rootProject.allprojects {
|
|
|
20
20
|
android {
|
|
21
21
|
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
|
22
22
|
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
23
|
+
namespace "io.sdk.uqudoid"
|
|
23
24
|
defaultConfig {
|
|
24
25
|
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
|
|
25
26
|
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
|
|
@@ -33,5 +34,5 @@ android {
|
|
|
33
34
|
|
|
34
35
|
dependencies {
|
|
35
36
|
implementation 'com.facebook.react:react-native:+'
|
|
36
|
-
implementation 'io.uqudo.sdk:Uqudo:3.
|
|
37
|
+
implementation 'io.uqudo.sdk:Uqudo:3.5.0'
|
|
37
38
|
}
|
|
@@ -42,6 +42,7 @@ import io.uqudo.sdk.core.domain.model.BackgroundCheckType;
|
|
|
42
42
|
import io.uqudo.sdk.core.domain.model.ObfuscationType;
|
|
43
43
|
import io.uqudo.sdk.core.domain.model.Document;
|
|
44
44
|
import io.uqudo.sdk.core.domain.model.DocumentType;
|
|
45
|
+
import io.uqudo.sdk.core.domain.model.LivenessGesture;
|
|
45
46
|
import java.text.SimpleDateFormat;
|
|
46
47
|
import java.util.TimeZone;
|
|
47
48
|
|
|
@@ -53,6 +54,7 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
|
|
|
53
54
|
public static final int REQUEST_CODE_ACCOUNT_RECOVERY = 1002;
|
|
54
55
|
public static final int REQUEST_CODE_FACE_SESSION = 1003;
|
|
55
56
|
public static final int REQUEST_CODE_LOOKUP = 1004;
|
|
57
|
+
public static final int REQUEST_CODE_READING = 1005;
|
|
56
58
|
|
|
57
59
|
public UqudoIdModule(ReactApplicationContext reactContext) {
|
|
58
60
|
super(reactContext);
|
|
@@ -170,6 +172,25 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
|
|
|
170
172
|
if (faceObject.has("isOneToNVerificationEnabled") && faceObject.getBoolean("isOneToNVerificationEnabled")) {
|
|
171
173
|
faceBuilder.enableOneToNVerification();
|
|
172
174
|
}
|
|
175
|
+
|
|
176
|
+
if (faceObject.has("enableActiveLiveness") && faceObject.getBoolean("enableActiveLiveness")) {
|
|
177
|
+
LivenessGesture disableGesture = null;
|
|
178
|
+
if (faceObject.has("disableLivenessGesture")) {
|
|
179
|
+
String gesture = faceObject.getString("disableLivenessGesture");
|
|
180
|
+
switch (gesture) {
|
|
181
|
+
case "FACE_MOVE":
|
|
182
|
+
disableGesture = LivenessGesture.FACE_MOVE;
|
|
183
|
+
break;
|
|
184
|
+
case "FACE_TILT":
|
|
185
|
+
disableGesture = LivenessGesture.FACE_TILT;
|
|
186
|
+
break;
|
|
187
|
+
case "FACE_TURN":
|
|
188
|
+
disableGesture = LivenessGesture.FACE_TURN;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
faceBuilder.enableActiveLiveness(disableGesture);
|
|
193
|
+
}
|
|
173
194
|
|
|
174
195
|
enrollment.enableFacialRecognition(faceBuilder.build());
|
|
175
196
|
}
|
|
@@ -371,6 +392,14 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
|
|
|
371
392
|
faceSession.enableAuditTrailImageObfuscation(ObfuscationType.FILLED_WHITE);
|
|
372
393
|
}
|
|
373
394
|
}
|
|
395
|
+
if (json.has("enableActiveLiveness") && json.getBoolean("enableActiveLiveness")) {
|
|
396
|
+
if (json.has("disableLivenessGesture")) {
|
|
397
|
+
LivenessGesture gesture = LivenessGesture.valueOf(json.getString("disableLivenessGesture"));
|
|
398
|
+
faceSession.enableActiveLiveness(gesture);
|
|
399
|
+
} else {
|
|
400
|
+
faceSession.enableActiveLiveness(null);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
374
403
|
Intent intent = faceSession.build(context);
|
|
375
404
|
if (json.has("appearanceMode")) {
|
|
376
405
|
if ("LIGHT".equals(json.getString("appearanceMode"))) {
|
|
@@ -443,6 +472,25 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
|
|
|
443
472
|
if (faceObject.has("isOneToNVerificationEnabled") && faceObject.getBoolean("isOneToNVerificationEnabled")) {
|
|
444
473
|
faceBuilder.enableOneToNVerification();
|
|
445
474
|
}
|
|
475
|
+
|
|
476
|
+
if (faceObject.has("enableActiveLiveness") && faceObject.getBoolean("enableActiveLiveness")) {
|
|
477
|
+
LivenessGesture disableGesture = null;
|
|
478
|
+
if (faceObject.has("disableLivenessGesture")) {
|
|
479
|
+
String gesture = faceObject.getString("disableLivenessGesture");
|
|
480
|
+
switch (gesture) {
|
|
481
|
+
case "FACE_MOVE":
|
|
482
|
+
disableGesture = LivenessGesture.FACE_MOVE;
|
|
483
|
+
break;
|
|
484
|
+
case "FACE_TILT":
|
|
485
|
+
disableGesture = LivenessGesture.FACE_TILT;
|
|
486
|
+
break;
|
|
487
|
+
case "FACE_TURN":
|
|
488
|
+
disableGesture = LivenessGesture.FACE_TURN;
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
faceBuilder.enableActiveLiveness(disableGesture);
|
|
493
|
+
}
|
|
446
494
|
lookupBuilder.enableFacialRecognition(faceBuilder.build());
|
|
447
495
|
}
|
|
448
496
|
if (json.has("backgroundCheckConfiguration")) {
|
|
@@ -531,6 +579,159 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
|
|
|
531
579
|
sendError(promise, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected valid document type as argument", null);
|
|
532
580
|
}
|
|
533
581
|
}
|
|
582
|
+
|
|
583
|
+
@ReactMethod
|
|
584
|
+
public void reading(String message, Promise promise) {
|
|
585
|
+
if (message != null && message.length() > 0) {
|
|
586
|
+
try {
|
|
587
|
+
JSONObject json = new JSONObject(message);
|
|
588
|
+
UqudoBuilder.Reading readingBuilder = new UqudoBuilder.Reading();
|
|
589
|
+
|
|
590
|
+
if (json.has("authorizationToken")) {
|
|
591
|
+
readingBuilder.setToken(json.getString("authorizationToken"));
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
if (json.has("sessionId")) {
|
|
595
|
+
readingBuilder.setSessionId(json.getString("sessionId"));
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
if (json.has("userIdentifier")) {
|
|
599
|
+
readingBuilder.setUserIdentifier(UUID.fromString(json.getString("userIdentifier")));
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
if (json.has("nonce")) {
|
|
603
|
+
readingBuilder.setNonce(json.getString("nonce"));
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
if (json.has("documentType")) {
|
|
607
|
+
readingBuilder.setDocumentType(DocumentType.valueOf(json.getString("documentType")));
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
if (json.has("documentNumber")) {
|
|
611
|
+
readingBuilder.setDocumentNumber(json.getString("documentNumber"));
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
if (json.has("dateOfBirth")) {
|
|
615
|
+
readingBuilder.setDateOfBirth(json.getString("dateOfBirth"));
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
if (json.has("dateOfExpiry")) {
|
|
619
|
+
readingBuilder.setDateOfExpiry(json.getString("dateOfExpiry"));
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
if (json.has("mrz")) {
|
|
623
|
+
readingBuilder.setMRZ(json.getString("mrz"));
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
if (json.has("isReturnDataForIncompleteSession") && json.getBoolean("isReturnDataForIncompleteSession")) {
|
|
627
|
+
readingBuilder.returnDataForIncompleteSession();
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
if (json.has("isSecuredWindowsDisabled") && json.getBoolean("isSecuredWindowsDisabled")) {
|
|
631
|
+
readingBuilder.disableSecureWindow();
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (json.has("facialRecognitionSpecification")) {
|
|
635
|
+
FacialRecognitionConfigurationBuilder faceBuilder = new FacialRecognitionConfigurationBuilder();
|
|
636
|
+
JSONObject faceObject = json.getJSONObject("facialRecognitionSpecification");
|
|
637
|
+
if (faceObject.has("enrollFace") && faceObject.getBoolean("enrollFace")) {
|
|
638
|
+
faceBuilder.enrollFace();
|
|
639
|
+
}
|
|
640
|
+
if (faceObject.has("scanMinimumMatchLevel") && faceObject.getInt("scanMinimumMatchLevel") > 0) {
|
|
641
|
+
faceBuilder.setScanMinimumMatchLevel(faceObject.getInt("scanMinimumMatchLevel"));
|
|
642
|
+
}
|
|
643
|
+
if (faceObject.has("readMinimumMatchLevel") && faceObject.getInt("readMinimumMatchLevel") > 0) {
|
|
644
|
+
faceBuilder.setReadMinimumMatchLevel(faceObject.getInt("readMinimumMatchLevel"));
|
|
645
|
+
}
|
|
646
|
+
if (faceObject.has("lookupMinimumMatchLevel") && faceObject.getInt("lookupMinimumMatchLevel") > 0) {
|
|
647
|
+
faceBuilder.setLookupMinimumMatchLevel(faceObject.getInt("lookupMinimumMatchLevel"));
|
|
648
|
+
}
|
|
649
|
+
if (faceObject.has("maxAttempts") && faceObject.getInt("maxAttempts") > 0) {
|
|
650
|
+
faceBuilder.setMaxAttempts(faceObject.getInt("maxAttempts"));
|
|
651
|
+
}
|
|
652
|
+
if (faceObject.has("allowClosedEyes") && faceObject.getBoolean("allowClosedEyes")) {
|
|
653
|
+
faceBuilder.allowClosedEyes();
|
|
654
|
+
}
|
|
655
|
+
if (faceObject.has("obfuscationType")){
|
|
656
|
+
if (faceObject.getString("obfuscationType").equals("FILLED")){
|
|
657
|
+
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED);
|
|
658
|
+
} else if (faceObject.getString("obfuscationType").equals("BLURRED")){
|
|
659
|
+
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.BLURRED);
|
|
660
|
+
} else if (faceObject.getString("obfuscationType").equals("FILLED_WHITE")){
|
|
661
|
+
faceBuilder.enableAuditTrailImageObfuscation(ObfuscationType.FILLED_WHITE);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (faceObject.has("isOneToNVerificationEnabled") && faceObject.getBoolean("isOneToNVerificationEnabled")) {
|
|
666
|
+
faceBuilder.enableOneToNVerification();
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if (faceObject.has("enableActiveLiveness") && faceObject.getBoolean("enableActiveLiveness")) {
|
|
670
|
+
LivenessGesture disableGesture = null;
|
|
671
|
+
if (faceObject.has("disableLivenessGesture")) {
|
|
672
|
+
String gesture = faceObject.getString("disableLivenessGesture");
|
|
673
|
+
switch (gesture) {
|
|
674
|
+
case "FACE_MOVE":
|
|
675
|
+
disableGesture = LivenessGesture.FACE_MOVE;
|
|
676
|
+
break;
|
|
677
|
+
case "FACE_TILT":
|
|
678
|
+
disableGesture = LivenessGesture.FACE_TILT;
|
|
679
|
+
break;
|
|
680
|
+
case "FACE_TURN":
|
|
681
|
+
disableGesture = LivenessGesture.FACE_TURN;
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
faceBuilder.enableActiveLiveness(disableGesture);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
readingBuilder.enableFacialRecognition(faceBuilder.build());
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (json.has("backgroundCheckConfiguration")) {
|
|
692
|
+
BackgroundCheckConfigurationBuilder backgroundCheckConfigurationBuilder = new BackgroundCheckConfigurationBuilder();
|
|
693
|
+
JSONObject backgroundObject = json.getJSONObject("backgroundCheckConfiguration");
|
|
694
|
+
if (backgroundObject.has("disableConsent") && backgroundObject.getBoolean("disableConsent")) {
|
|
695
|
+
backgroundCheckConfigurationBuilder.disableConsent();
|
|
696
|
+
}
|
|
697
|
+
if (backgroundObject.has("backgroundCheckType")) {
|
|
698
|
+
backgroundCheckConfigurationBuilder.setBackgroundCheckType(BackgroundCheckType.valueOf(backgroundObject.getString("backgroundCheckType")));
|
|
699
|
+
}
|
|
700
|
+
if (backgroundObject.has("monitoringEnabled") && backgroundObject.getBoolean("monitoringEnabled")) {
|
|
701
|
+
backgroundCheckConfigurationBuilder.enableMonitoring();
|
|
702
|
+
}
|
|
703
|
+
if (backgroundObject.has("skipView") && backgroundObject.getBoolean("skipView")) {
|
|
704
|
+
backgroundCheckConfigurationBuilder.skipView();
|
|
705
|
+
}
|
|
706
|
+
readingBuilder.enableBackgroundCheck(backgroundCheckConfigurationBuilder.build());
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
if (json.has("isLookupEnabled") && json.getBoolean("isLookupEnabled")) {
|
|
710
|
+
readingBuilder.enableLookup();
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
Intent intent = readingBuilder.build(context);
|
|
714
|
+
if (json.has("appearanceMode")) {
|
|
715
|
+
if ("LIGHT".equals(json.getString("appearanceMode"))) {
|
|
716
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
717
|
+
} else if ("DARK".equals(json.getString("appearanceMode"))) {
|
|
718
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
719
|
+
} else if ("SYSTEM".equals(json.getString("appearanceMode"))) {
|
|
720
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
721
|
+
}
|
|
722
|
+
} else {
|
|
723
|
+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
|
724
|
+
}
|
|
725
|
+
getReactApplicationContext().startActivityForResult(intent, REQUEST_CODE_READING, null);
|
|
726
|
+
mPromises.put(REQUEST_CODE_READING, promise);
|
|
727
|
+
} catch (Exception e) {
|
|
728
|
+
Log.e("UqudoIdModule", e.getMessage(), e);
|
|
729
|
+
sendError(promise, SessionStatusCode.UNEXPECTED_ERROR.name(), e.getMessage(), null);
|
|
730
|
+
}
|
|
731
|
+
} else {
|
|
732
|
+
sendError(promise, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected reading object as argument.", null);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
534
735
|
|
|
535
736
|
private void sendError(Promise promise, String code, String message, String task) {
|
|
536
737
|
sendError(promise, code, message, task, null);
|
|
@@ -555,7 +756,7 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
|
|
|
555
756
|
if (promise == null) {
|
|
556
757
|
return;
|
|
557
758
|
}
|
|
558
|
-
if (requestCode == REQUEST_CODE_ENROLLMENT || requestCode == REQUEST_CODE_ACCOUNT_RECOVERY || requestCode == REQUEST_CODE_FACE_SESSION || requestCode == REQUEST_CODE_LOOKUP) {
|
|
759
|
+
if (requestCode == REQUEST_CODE_ENROLLMENT || requestCode == REQUEST_CODE_ACCOUNT_RECOVERY || requestCode == REQUEST_CODE_FACE_SESSION || requestCode == REQUEST_CODE_LOOKUP || requestCode == REQUEST_CODE_READING) {
|
|
559
760
|
if (resultCode == Activity.RESULT_OK) {
|
|
560
761
|
WritableMap map = Arguments.createMap();
|
|
561
762
|
map.putString("result", data.getStringExtra("data"));
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./uqudoBuilder/uqudo";
|
|
1
|
+
export * from "./uqudoBuilder/uqudo.js";
|
package/ios/UqudoId.m
CHANGED
|
@@ -82,10 +82,10 @@ RCT_EXPORT_METHOD(enroll:(NSString *)enrollObj resolver:(RCTPromiseResolveBlock)
|
|
|
82
82
|
config.readMinimumMatchLevel = [[facialRecognitionSpecification valueForKey:@"readMinimumMatchLevel"] integerValue];
|
|
83
83
|
}
|
|
84
84
|
if (facialRecognitionSpecification[@"maxAttempts"]) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
int maxAttempts = [[facialRecognitionSpecification valueForKey:@"maxAttempts"] intValue];
|
|
86
|
+
if (maxAttempts > 0) {
|
|
87
|
+
config.maxAttempts = maxAttempts;
|
|
88
|
+
}
|
|
89
89
|
}
|
|
90
90
|
if (facialRecognitionSpecification[@"allowClosedEyes"]) {
|
|
91
91
|
config.allowClosedEyes = [[facialRecognitionSpecification valueForKey:@"allowClosedEyes"] boolValue];
|
|
@@ -104,23 +104,38 @@ RCT_EXPORT_METHOD(enroll:(NSString *)enrollObj resolver:(RCTPromiseResolveBlock)
|
|
|
104
104
|
config.enableOneToNVerification = [[facialRecognitionSpecification valueForKey:@"isOneToNVerificationEnabled"] boolValue];
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
if (facialRecognitionSpecification[@"enableActiveLiveness"] && [facialRecognitionSpecification[@"enableActiveLiveness"] boolValue]) {
|
|
108
|
+
config.enableActiveLiveness = YES;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (facialRecognitionSpecification[@"disableLivenessGesture"]) {
|
|
112
|
+
NSString *gesture = facialRecognitionSpecification[@"disableLivenessGesture"];
|
|
113
|
+
if ([gesture isEqualToString:@"FACE_MOVE"]) {
|
|
114
|
+
config.disableLivenessGesture = FACE_MOVE;
|
|
115
|
+
} else if ([gesture isEqualToString:@"FACE_TILT"]) {
|
|
116
|
+
config.disableLivenessGesture = FACE_TILT;
|
|
117
|
+
} else if ([gesture isEqualToString:@"FACE_TURN"]) {
|
|
118
|
+
config.disableLivenessGesture = FACE_TURN;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
107
122
|
enrollmentBuilder.facialRecognitionConfig = config;
|
|
108
123
|
}
|
|
109
124
|
|
|
110
125
|
if(lookupConfiguration){
|
|
111
126
|
NSMutableArray *lookupDocumentTypes = [[NSMutableArray alloc] init];
|
|
112
|
-
|
|
127
|
+
if(lookupConfiguration[@"documentList"]){
|
|
113
128
|
for (NSString *document in lookupConfiguration[@"documentList"]) {
|
|
114
|
-
|
|
129
|
+
UQDocumentConfig *documentConfig = [[UQDocumentConfig alloc] initWithDocumentTypeName:document];
|
|
115
130
|
[lookupDocumentTypes addObject:[NSNumber numberWithInteger:[documentConfig documentType]]];
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (lookupDocumentTypes.count) {
|
|
134
|
+
[enrollmentBuilder enableLookup:lookupDocumentTypes];
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
[enrollmentBuilder enableLookup];
|
|
138
|
+
}
|
|
124
139
|
}
|
|
125
140
|
if (backgroundCheckConfiguration) {
|
|
126
141
|
BOOL isDisableConsent = FALSE;
|
|
@@ -128,8 +143,8 @@ RCT_EXPORT_METHOD(enroll:(NSString *)enrollObj resolver:(RCTPromiseResolveBlock)
|
|
|
128
143
|
if (backgroundCheckConfiguration[@"disableConsent"]) {
|
|
129
144
|
isDisableConsent = [[backgroundCheckConfiguration valueForKey:@"disableConsent"] boolValue];
|
|
130
145
|
}
|
|
131
|
-
if (backgroundCheckConfiguration[@"
|
|
132
|
-
if ([backgroundCheckConfiguration[@"
|
|
146
|
+
if (backgroundCheckConfiguration[@"backgroundCheckType"]) {
|
|
147
|
+
if ([backgroundCheckConfiguration[@"backgroundCheckType"] isEqual:@"RDC"]) {
|
|
133
148
|
type = RDC;
|
|
134
149
|
} else {
|
|
135
150
|
type = DOW_JONES;
|
|
@@ -160,11 +175,11 @@ RCT_EXPORT_METHOD(enroll:(NSString *)enrollObj resolver:(RCTPromiseResolveBlock)
|
|
|
160
175
|
scanConfig.faceMinimumMatchLevel = [[document valueForKey:@"faceScanMinimumMatchLevel"] intValue];
|
|
161
176
|
}
|
|
162
177
|
if (document[@"minimumAge"]) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
int minimumAge = [[document valueForKey:@"minimumAge"] intValue];
|
|
179
|
+
if (minimumAge > 0) {
|
|
180
|
+
documentObject.enableAgeVerification = minimumAge;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
168
183
|
|
|
169
184
|
BOOL isEnableFrontSideReview = false;
|
|
170
185
|
BOOL isEnableBackSideReview = false;
|
|
@@ -190,27 +205,27 @@ RCT_EXPORT_METHOD(enroll:(NSString *)enrollObj resolver:(RCTPromiseResolveBlock)
|
|
|
190
205
|
}
|
|
191
206
|
|
|
192
207
|
if (document[@"readingConfiguration"]) {
|
|
193
|
-
|
|
208
|
+
NSDictionary *readingConfiguration = document[@"readingConfiguration"];
|
|
194
209
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
210
|
+
UQReadingConfig *readConfig = [[UQReadingConfig alloc] init];
|
|
211
|
+
readConfig.enableReading = TRUE;
|
|
212
|
+
if (readingConfiguration[@"forceReading"]) {
|
|
213
|
+
[readConfig forceReading:[[readingConfiguration valueForKey:@"forceReading"] boolValue]];
|
|
214
|
+
}
|
|
215
|
+
if (readingConfiguration[@"forceReadingIfSupported"]) {
|
|
216
|
+
[readConfig forceReadingIfSupported:[[readingConfiguration valueForKey:@"forceReadingIfSupported"] boolValue]];
|
|
217
|
+
}
|
|
218
|
+
if (document[@"faceReadMinimumMatchLevel"]) {
|
|
219
|
+
readConfig.faceMinimumMatchLevel = [[document valueForKey:@"faceReadMinimumMatchLevel"] intValue];
|
|
220
|
+
}
|
|
221
|
+
if (readingConfiguration[@"timeoutInSeconds"]) {
|
|
222
|
+
int timeoutInSeconds = [[readingConfiguration valueForKey:@"timeoutInSeconds"] intValue];
|
|
223
|
+
if (timeoutInSeconds > 0) {
|
|
224
|
+
readConfig.forceReadingTimeout = timeoutInSeconds;
|
|
211
225
|
}
|
|
226
|
+
}
|
|
212
227
|
|
|
213
|
-
|
|
228
|
+
documentObject.reading = readConfig;
|
|
214
229
|
}
|
|
215
230
|
|
|
216
231
|
[enrollmentBuilder add:documentObject];
|
|
@@ -302,9 +317,9 @@ RCT_EXPORT_METHOD(recover:(NSString *)recoverObj resolver:(RCTPromiseResolveBloc
|
|
|
302
317
|
|
|
303
318
|
NSInteger appearanceMode = SYSTEM;
|
|
304
319
|
if (json[@"appearanceMode"]) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
320
|
+
if ([json[@"appearanceMode"] isEqualToString:@"LIGHT"]) {
|
|
321
|
+
appearanceMode = LIGHT;
|
|
322
|
+
} else if ([json[@"appearanceMode"] isEqualToString:@"DARK"]) {
|
|
308
323
|
appearanceMode = DARK;
|
|
309
324
|
}
|
|
310
325
|
}
|
|
@@ -393,7 +408,22 @@ RCT_EXPORT_METHOD(faceSession:(NSString *)configuration resolver:(RCTPromiseReso
|
|
|
393
408
|
[faceSessionBuilder enableAuditTrailImageObfuscation:FILLED_WHITE];
|
|
394
409
|
}
|
|
395
410
|
}
|
|
396
|
-
|
|
411
|
+
|
|
412
|
+
if (json[@"enableActiveLiveness"] && [json[@"enableActiveLiveness"] boolValue]) {
|
|
413
|
+
faceSessionBuilder.enableActiveLiveness = YES;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (json[@"disableLivenessGesture"]) {
|
|
417
|
+
NSString *gesture = json[@"disableLivenessGesture"];
|
|
418
|
+
if ([gesture isEqualToString:@"FACE_MOVE"]) {
|
|
419
|
+
faceSessionBuilder.disableLivenessGesture = FACE_MOVE;
|
|
420
|
+
} else if ([gesture isEqualToString:@"FACE_TILT"]) {
|
|
421
|
+
faceSessionBuilder.disableLivenessGesture = FACE_TILT;
|
|
422
|
+
} else if ([gesture isEqualToString:@"FACE_TURN"]) {
|
|
423
|
+
faceSessionBuilder.disableLivenessGesture = FACE_TURN;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
397
427
|
builderController.delegate = self;
|
|
398
428
|
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
|
399
429
|
builderController.appViewController = rootViewController;
|
|
@@ -401,11 +431,11 @@ RCT_EXPORT_METHOD(faceSession:(NSString *)configuration resolver:(RCTPromiseReso
|
|
|
401
431
|
|
|
402
432
|
NSInteger appearanceMode = SYSTEM;
|
|
403
433
|
if (json[@"appearanceMode"]) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
434
|
+
if ([json[@"appearanceMode"] isEqualToString:@"LIGHT"]) {
|
|
435
|
+
appearanceMode = LIGHT;
|
|
436
|
+
} else if ([json[@"appearanceMode"] isEqualToString:@"DARK"]) {
|
|
437
|
+
appearanceMode = DARK;
|
|
438
|
+
}
|
|
409
439
|
}
|
|
410
440
|
[builderController setAppearanceMode:appearanceMode];
|
|
411
441
|
});
|
|
@@ -490,10 +520,10 @@ RCT_EXPORT_METHOD(lookup:(NSString *)lookupObj resolver:(RCTPromiseResolveBlock)
|
|
|
490
520
|
config.minimumMatchLevel = [[facialRecognitionSpecification valueForKey:@"lookupMinimumMatchLevel"] integerValue];
|
|
491
521
|
}
|
|
492
522
|
if (facialRecognitionSpecification[@"maxAttempts"]) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
523
|
+
int maxAttempts = [[facialRecognitionSpecification valueForKey:@"maxAttempts"] intValue];
|
|
524
|
+
if (maxAttempts > 0) {
|
|
525
|
+
config.maxAttempts = maxAttempts;
|
|
526
|
+
}
|
|
497
527
|
}
|
|
498
528
|
if (facialRecognitionSpecification[@"allowClosedEyes"]) {
|
|
499
529
|
config.allowClosedEyes = [[facialRecognitionSpecification valueForKey:@"allowClosedEyes"] boolValue];
|
|
@@ -512,6 +542,21 @@ RCT_EXPORT_METHOD(lookup:(NSString *)lookupObj resolver:(RCTPromiseResolveBlock)
|
|
|
512
542
|
config.enableOneToNVerification = [[facialRecognitionSpecification valueForKey:@"isOneToNVerificationEnabled"] boolValue];
|
|
513
543
|
}
|
|
514
544
|
|
|
545
|
+
if (facialRecognitionSpecification[@"enableActiveLiveness"] && [facialRecognitionSpecification[@"enableActiveLiveness"] boolValue]) {
|
|
546
|
+
config.enableActiveLiveness = YES;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
if (facialRecognitionSpecification[@"disableLivenessGesture"]) {
|
|
550
|
+
NSString *gesture = facialRecognitionSpecification[@"disableLivenessGesture"];
|
|
551
|
+
if ([gesture isEqualToString:@"FACE_MOVE"]) {
|
|
552
|
+
config.disableLivenessGesture = FACE_MOVE;
|
|
553
|
+
} else if ([gesture isEqualToString:@"FACE_TILT"]) {
|
|
554
|
+
config.disableLivenessGesture = FACE_TILT;
|
|
555
|
+
} else if ([gesture isEqualToString:@"FACE_TURN"]) {
|
|
556
|
+
config.disableLivenessGesture = FACE_TURN;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
515
560
|
lookupBuilder.facialRecognitionConfig = config;
|
|
516
561
|
|
|
517
562
|
}
|
|
@@ -522,8 +567,8 @@ RCT_EXPORT_METHOD(lookup:(NSString *)lookupObj resolver:(RCTPromiseResolveBlock)
|
|
|
522
567
|
if (backgroundCheckConfiguration[@"disableConsent"]) {
|
|
523
568
|
isDisableConsent = [[backgroundCheckConfiguration valueForKey:@"disableConsent"] boolValue];
|
|
524
569
|
}
|
|
525
|
-
if (backgroundCheckConfiguration[@"
|
|
526
|
-
if ([backgroundCheckConfiguration[@"
|
|
570
|
+
if (backgroundCheckConfiguration[@"backgroundCheckType"]) {
|
|
571
|
+
if ([backgroundCheckConfiguration[@"backgroundCheckType"] isEqual:@"RDC"]) {
|
|
527
572
|
type = RDC;
|
|
528
573
|
} else {
|
|
529
574
|
type = DOW_JONES;
|
|
@@ -585,76 +630,262 @@ RCT_EXPORT_METHOD(lookup:(NSString *)lookupObj resolver:(RCTPromiseResolveBlock)
|
|
|
585
630
|
RCT_EXPORT_METHOD(isReadingSupported:(NSString *)documentType resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
586
631
|
self.promiseReject = reject;
|
|
587
632
|
@try{
|
|
588
|
-
|
|
589
|
-
|
|
633
|
+
UQDocumentConfig *documentObject = [[UQDocumentConfig alloc] initWithDocumentTypeName:documentType];
|
|
634
|
+
resolve(@(documentObject.isSupportReading));
|
|
635
|
+
}
|
|
636
|
+
@catch (NSException *exception) {
|
|
637
|
+
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
638
|
+
status.statusCode = UNEXPECTED_ERROR;
|
|
639
|
+
status.message = @"Expected valid document type as argument";
|
|
640
|
+
status.statusTask = -1;
|
|
641
|
+
[self sendPluginError:status];
|
|
590
642
|
}
|
|
591
|
-
@catch (NSException *exception) {
|
|
592
|
-
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
593
|
-
status.statusCode = UNEXPECTED_ERROR;
|
|
594
|
-
status.message = @"Expected valid document type as argument";
|
|
595
|
-
status.statusTask = -1;
|
|
596
|
-
[self sendPluginError:status];
|
|
597
|
-
}
|
|
598
643
|
}
|
|
599
644
|
|
|
600
645
|
RCT_EXPORT_METHOD(isFacialRecognitionSupported:(NSString *)documentType resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
601
646
|
self.promiseReject = reject;
|
|
602
647
|
@try{
|
|
603
|
-
|
|
604
|
-
|
|
648
|
+
UQDocumentConfig *documentObject = [[UQDocumentConfig alloc] initWithDocumentTypeName:documentType];
|
|
649
|
+
resolve(@(documentObject.isSupportFaceRecognition));
|
|
650
|
+
}
|
|
651
|
+
@catch (NSException *exception) {
|
|
652
|
+
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
653
|
+
status.statusCode = UNEXPECTED_ERROR;
|
|
654
|
+
status.message = @"Expected valid document type as argument";
|
|
655
|
+
status.statusTask = -1;
|
|
656
|
+
[self sendPluginError:status];
|
|
605
657
|
}
|
|
606
|
-
@catch (NSException *exception) {
|
|
607
|
-
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
608
|
-
status.statusCode = UNEXPECTED_ERROR;
|
|
609
|
-
status.message = @"Expected valid document type as argument";
|
|
610
|
-
status.statusTask = -1;
|
|
611
|
-
[self sendPluginError:status];
|
|
612
|
-
}
|
|
613
658
|
}
|
|
614
659
|
|
|
615
660
|
RCT_EXPORT_METHOD(isEnrollmentSupported:(NSString *)documentType resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
616
661
|
self.promiseReject = reject;
|
|
617
662
|
@try{
|
|
618
|
-
|
|
619
|
-
|
|
663
|
+
UQDocumentConfig *documentObject = [[UQDocumentConfig alloc] initWithDocumentTypeName:documentType];
|
|
664
|
+
resolve(@(documentObject.isEnrollmentSupported));
|
|
665
|
+
}
|
|
666
|
+
@catch (NSException *exception) {
|
|
667
|
+
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
668
|
+
status.statusCode = UNEXPECTED_ERROR;
|
|
669
|
+
status.message = @"Expected valid document type as argument";
|
|
670
|
+
status.statusTask = -1;
|
|
671
|
+
[self sendPluginError:status];
|
|
620
672
|
}
|
|
621
|
-
@catch (NSException *exception) {
|
|
622
|
-
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
623
|
-
status.statusCode = UNEXPECTED_ERROR;
|
|
624
|
-
status.message = @"Expected valid document type as argument";
|
|
625
|
-
status.statusTask = -1;
|
|
626
|
-
[self sendPluginError:status];
|
|
627
|
-
}
|
|
628
673
|
}
|
|
629
674
|
|
|
630
675
|
RCT_EXPORT_METHOD(isLookupSupported:(NSString *)documentType resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
631
676
|
self.promiseReject = reject;
|
|
632
677
|
@try{
|
|
633
|
-
|
|
634
|
-
|
|
678
|
+
UQDocumentConfig *documentObject = [[UQDocumentConfig alloc] initWithDocumentTypeName:documentType];
|
|
679
|
+
resolve(@(documentObject.isLookupSupported));
|
|
680
|
+
}
|
|
681
|
+
@catch (NSException *exception) {
|
|
682
|
+
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
683
|
+
status.statusCode = UNEXPECTED_ERROR;
|
|
684
|
+
status.message = @"Expected valid document type as argument";
|
|
685
|
+
status.statusTask = -1;
|
|
686
|
+
[self sendPluginError:status];
|
|
635
687
|
}
|
|
636
|
-
@catch (NSException *exception) {
|
|
637
|
-
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
638
|
-
status.statusCode = UNEXPECTED_ERROR;
|
|
639
|
-
status.message = @"Expected valid document type as argument";
|
|
640
|
-
status.statusTask = -1;
|
|
641
|
-
[self sendPluginError:status];
|
|
642
|
-
}
|
|
643
688
|
}
|
|
644
689
|
|
|
645
690
|
RCT_EXPORT_METHOD(isLookupFacialRecognitionSupported:(NSString *)documentType resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
646
691
|
self.promiseReject = reject;
|
|
647
692
|
@try{
|
|
648
|
-
|
|
649
|
-
|
|
693
|
+
UQDocumentConfig *documentObject = [[UQDocumentConfig alloc] initWithDocumentTypeName:documentType];
|
|
694
|
+
resolve(@(documentObject.isLookupFacialRecognitionSupported));
|
|
650
695
|
}
|
|
651
|
-
|
|
652
|
-
|
|
696
|
+
@catch (NSException *exception) {
|
|
697
|
+
UQSessionStatus *status =[[UQSessionStatus alloc] init];
|
|
698
|
+
status.statusCode = UNEXPECTED_ERROR;
|
|
699
|
+
status.message = @"Expected valid document type as argument";
|
|
700
|
+
status.statusTask = -1;
|
|
701
|
+
[self sendPluginError:status];
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
RCT_EXPORT_METHOD(reading:(NSString *)readingObj resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
706
|
+
self.promiseResolve = resolve;
|
|
707
|
+
self.promiseReject = reject;
|
|
708
|
+
|
|
709
|
+
@try {
|
|
710
|
+
if (readingObj != nil && [readingObj length] > 0) {
|
|
711
|
+
UQBuilderController *builderController = [UQBuilderController defaultBuilder];
|
|
712
|
+
dispatch_sync(dispatch_get_main_queue(), ^{
|
|
713
|
+
NSData *data = [readingObj dataUsingEncoding:NSUTF8StringEncoding];
|
|
714
|
+
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
|
|
715
|
+
|
|
716
|
+
UQReadingBuilder *readingBuilder = [[UQReadingBuilder alloc] init];
|
|
717
|
+
readingBuilder.delegate = self;
|
|
718
|
+
|
|
719
|
+
if (json[@"authorizationToken"]) {
|
|
720
|
+
readingBuilder.authorizationToken = json[@"authorizationToken"];
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if (json[@"sessionId"]) {
|
|
724
|
+
readingBuilder.sessionID = json[@"sessionId"];
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
NSString* userIdentifier = json[@"userIdentifier"];
|
|
728
|
+
if (userIdentifier && userIdentifier.length > 0) {
|
|
729
|
+
readingBuilder.userIdentifier = userIdentifier;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (json[@"nonce"]) {
|
|
733
|
+
readingBuilder.nonce = json[@"nonce"];
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
if (json[@"documentType"]) {
|
|
737
|
+
UQDocumentConfig *documentObject = [[UQDocumentConfig alloc] initWithDocumentTypeName:json[@"documentType"]];
|
|
738
|
+
readingBuilder.documentType = documentObject.documentType;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
if (json[@"documentNumber"]) {
|
|
742
|
+
readingBuilder.documentNumber = json[@"documentNumber"];
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
if (json[@"dateOfBirth"]) {
|
|
746
|
+
readingBuilder.dateOfBirth = json[@"dateOfBirth"];
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
if (json[@"dateOfExpiry"]) {
|
|
750
|
+
readingBuilder.dateOfExpiry = json[@"dateOfExpiry"];
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
if (json[@"mrz"]) {
|
|
754
|
+
readingBuilder.mrz = json[@"mrz"];
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
if (json[@"isReturnDataForIncompleteSession"]) {
|
|
758
|
+
readingBuilder.returnDataForIncompleteSession = [[json valueForKey:@"isReturnDataForIncompleteSession"] boolValue];
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
if (json[@"facialRecognitionSpecification"]) {
|
|
762
|
+
NSDictionary *frConfig = json[@"facialRecognitionSpecification"];
|
|
763
|
+
UQFacialRecognitionConfig *config = [[UQFacialRecognitionConfig alloc] init];
|
|
764
|
+
config.enableFacialRecognition = YES;
|
|
765
|
+
|
|
766
|
+
if (frConfig[@"enrollFace"] && [frConfig[@"enrollFace"] boolValue]) {
|
|
767
|
+
config.enrollFace = YES;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
if (frConfig[@"scanMinimumMatchLevel"]) {
|
|
771
|
+
config.scanMinimumMatchLevel = [frConfig[@"scanMinimumMatchLevel"] intValue];
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
if (frConfig[@"readMinimumMatchLevel"]) {
|
|
775
|
+
config.readMinimumMatchLevel = [frConfig[@"readMinimumMatchLevel"] intValue];
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (frConfig[@"lookupMinimumMatchLevel"]) {
|
|
779
|
+
config.minimumMatchLevel = [frConfig[@"lookupMinimumMatchLevel"] intValue];
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
if (frConfig[@"maxAttempts"]) {
|
|
783
|
+
int maxAttempts = [frConfig[@"maxAttempts"] intValue];
|
|
784
|
+
if (maxAttempts > 0) {
|
|
785
|
+
config.maxAttempts = maxAttempts;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
if (frConfig[@"allowClosedEyes"] && [frConfig[@"allowClosedEyes"] boolValue]) {
|
|
790
|
+
config.allowClosedEyes = YES;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
if (frConfig[@"obfuscationType"]) {
|
|
794
|
+
if ([frConfig[@"obfuscationType"] isEqualToString:@"BLURRED"]) {
|
|
795
|
+
config.obfuscationType = BLURRED;
|
|
796
|
+
} else if ([frConfig[@"obfuscationType"] isEqualToString:@"FILLED"]) {
|
|
797
|
+
config.obfuscationType = FILLED;
|
|
798
|
+
} else if ([frConfig[@"obfuscationType"] isEqualToString:@"FILLED_WHITE"]) {
|
|
799
|
+
config.obfuscationType = FILLED_WHITE;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
if (frConfig[@"isOneToNVerificationEnabled"] && [frConfig[@"isOneToNVerificationEnabled"] boolValue]) {
|
|
804
|
+
config.enableOneToNVerification = YES;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
if (frConfig[@"enableActiveLiveness"] && [frConfig[@"enableActiveLiveness"] boolValue]) {
|
|
808
|
+
config.enableActiveLiveness = YES;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
if (frConfig[@"disableLivenessGesture"]) {
|
|
812
|
+
NSString *gesture = frConfig[@"disableLivenessGesture"];
|
|
813
|
+
if ([gesture isEqualToString:@"FACE_MOVE"]) {
|
|
814
|
+
config.disableLivenessGesture = FACE_MOVE;
|
|
815
|
+
} else if ([gesture isEqualToString:@"FACE_TILT"]) {
|
|
816
|
+
config.disableLivenessGesture = FACE_TILT;
|
|
817
|
+
} else if ([gesture isEqualToString:@"FACE_TURN"]) {
|
|
818
|
+
config.disableLivenessGesture = FACE_TURN;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
readingBuilder.facialRecognitionConfig = config;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
if (json[@"backgroundCheckConfiguration"]) {
|
|
826
|
+
NSDictionary *bgConfig = json[@"backgroundCheckConfiguration"];
|
|
827
|
+
|
|
828
|
+
BOOL isDisableConsent = bgConfig[@"disableConsent"] && [bgConfig[@"disableConsent"] boolValue];
|
|
829
|
+
BOOL isMonitoringEnabled = bgConfig[@"monitoringEnabled"] && [bgConfig[@"monitoringEnabled"] boolValue];
|
|
830
|
+
BOOL isSkipView = bgConfig[@"skipView"] && [bgConfig[@"skipView"] boolValue];
|
|
831
|
+
|
|
832
|
+
BackgroundCheckType type = RDC;
|
|
833
|
+
if (bgConfig[@"backgroundCheckType"]) {
|
|
834
|
+
if ([bgConfig[@"backgroundCheckType"] isEqualToString:@"DOW_JONES"]) {
|
|
835
|
+
type = DOW_JONES;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
[readingBuilder enableBackgroundCheck:isDisableConsent type:type monitoring:isMonitoringEnabled skipView:isSkipView];
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
if (json[@"isLookupEnabled"] && [json[@"isLookupEnabled"] boolValue]) {
|
|
843
|
+
[readingBuilder enableLookup];
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
builderController.delegate = self;
|
|
847
|
+
[builderController setReading:readingBuilder];
|
|
848
|
+
|
|
849
|
+
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
|
850
|
+
builderController.appViewController = rootViewController;
|
|
851
|
+
|
|
852
|
+
NSInteger appearanceMode = SYSTEM;
|
|
853
|
+
if (json[@"appearanceMode"]) {
|
|
854
|
+
if ([json[@"appearanceMode"] isEqualToString:@"LIGHT"]) {
|
|
855
|
+
appearanceMode = LIGHT;
|
|
856
|
+
} else if ([json[@"appearanceMode"] isEqualToString:@"DARK"]) {
|
|
857
|
+
appearanceMode = DARK;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
[builderController setAppearanceMode:appearanceMode];
|
|
861
|
+
});
|
|
862
|
+
[builderController performReading];
|
|
863
|
+
} else {
|
|
864
|
+
UQSessionStatus *status = [[UQSessionStatus alloc] init];
|
|
653
865
|
status.statusCode = UNEXPECTED_ERROR;
|
|
654
|
-
status.message = @"Expected
|
|
866
|
+
status.message = @"Expected reading object as argument.";
|
|
655
867
|
status.statusTask = -1;
|
|
656
868
|
[self sendPluginError:status];
|
|
657
|
-
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
@catch (NSException *exception) {
|
|
872
|
+
NSLog(@"%@", exception.callStackSymbols);
|
|
873
|
+
UQSessionStatus *status = [[UQSessionStatus alloc] init];
|
|
874
|
+
status.statusCode = UNEXPECTED_ERROR;
|
|
875
|
+
status.message = exception.reason;
|
|
876
|
+
status.statusTask = -1;
|
|
877
|
+
[self sendPluginError:status];
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
- (void)didReadingCompleteWithInfo:(nonnull NSString *)jwsString {
|
|
882
|
+
NSMutableDictionary *jsonResults = [[NSMutableDictionary alloc]init];
|
|
883
|
+
[jsonResults setValue:jwsString forKey:@"result"];
|
|
884
|
+
self.promiseResolve(jsonResults);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
- (void)didReadingIncompleteWithStatus:(UQSessionStatus *)status {
|
|
888
|
+
[self sendPluginError:status];
|
|
658
889
|
}
|
|
659
890
|
|
|
660
891
|
- (void)sendPluginError:(UQSessionStatus *)status {
|
|
@@ -690,6 +921,9 @@ RCT_EXPORT_METHOD(isLookupFacialRecognitionSupported:(NSString *)documentType re
|
|
|
690
921
|
case SESSION_INVALIDATED_CAMERA_PERMISSION_NOT_GRANTED:
|
|
691
922
|
code = @"SESSION_INVALIDATED_CAMERA_PERMISSION_NOT_GRANTED";
|
|
692
923
|
break;
|
|
924
|
+
case SESSION_INVALIDATED_READING_AUTHENTICATION_FAILED:
|
|
925
|
+
code = @"SESSION_INVALIDATED_READING_AUTHENTICATION_FAILED";
|
|
926
|
+
break;
|
|
693
927
|
}
|
|
694
928
|
NSString *task = nil;
|
|
695
929
|
switch (status.statusTask) {
|
|
@@ -730,7 +964,7 @@ RCT_EXPORT_METHOD(isLookupFacialRecognitionSupported:(NSString *)documentType re
|
|
|
730
964
|
|
|
731
965
|
-(void)stopObserving {
|
|
732
966
|
if(tracer != nil) {
|
|
733
|
-
|
|
967
|
+
tracer.hasListeners = NO;
|
|
734
968
|
}
|
|
735
969
|
}
|
|
736
970
|
|
package/package.json
CHANGED
package/uqudoBuilder/uqudo.js
CHANGED
|
@@ -52,6 +52,11 @@ export class UqudoIdSDK {
|
|
|
52
52
|
return await NativeModules.UqudoId.isEnrollmentSupported(documentType);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
async reading(readingConfiguration) {
|
|
56
|
+
var result = await NativeModules.UqudoId.reading(JSON.stringify(readingConfiguration));
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
export const DocumentType = Object.freeze(
|
|
@@ -113,6 +118,9 @@ export const DocumentType = Object.freeze(
|
|
|
113
118
|
LBN_DL: 'LBN_DL',
|
|
114
119
|
MRZ: 'MRZ',
|
|
115
120
|
IRQ_ID: 'IRQ_ID',
|
|
121
|
+
IDN_ID: 'IDN_ID',
|
|
122
|
+
IRQ_ID_NATIONAL: 'IRQ_ID_NATIONAL',
|
|
123
|
+
IRQ_ID_RESIDENT: 'IRQ_ID_RESIDENT',
|
|
116
124
|
UAE_ID_DIGITAL: 'UAE_ID_DIGITAL',
|
|
117
125
|
QAT_VL:'QAT_VL',
|
|
118
126
|
UAE_PASSPORT_DIGITAL: 'UAE_PASSPORT_DIGITAL',
|
|
@@ -144,6 +152,14 @@ export const AppearanceMode = Object.freeze(
|
|
|
144
152
|
}
|
|
145
153
|
);
|
|
146
154
|
|
|
155
|
+
export const LivenessGesture = Object.freeze(
|
|
156
|
+
{
|
|
157
|
+
FACE_MOVE: 'FACE_MOVE',
|
|
158
|
+
FACE_TILT: 'FACE_TILT',
|
|
159
|
+
FACE_TURN: 'FACE_TURN'
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
|
|
147
163
|
export const ObfuscationType = Object.freeze(
|
|
148
164
|
{
|
|
149
165
|
FILLED: 'FILLED',
|
|
@@ -311,8 +327,16 @@ export class FacialRecognitionConfigurationBuilder {
|
|
|
311
327
|
return this;
|
|
312
328
|
},
|
|
313
329
|
|
|
330
|
+
enableActiveLiveness: function (gesture) {
|
|
331
|
+
this.enableActiveLiveness = true;
|
|
332
|
+
if (gesture) {
|
|
333
|
+
this.disableLivenessGesture = gesture;
|
|
334
|
+
}
|
|
335
|
+
return this;
|
|
336
|
+
},
|
|
337
|
+
|
|
314
338
|
build: function () {
|
|
315
|
-
return new FacialRecognitionConfiguration(this.enrollFace, this.scanMinimumMatchLevel, this.readMinimumMatchLevel, this.lookupMinimumMatchLevel, this.maxAttempts,this.isAllowClosedEyes,this.obfuscationType,this.isOneToNVerificationEnabled);
|
|
339
|
+
return new FacialRecognitionConfiguration(this.enrollFace, this.scanMinimumMatchLevel, this.readMinimumMatchLevel, this.lookupMinimumMatchLevel, this.maxAttempts,this.isAllowClosedEyes,this.obfuscationType,this.isOneToNVerificationEnabled,this.enableActiveLiveness,this.disableLivenessGesture);
|
|
316
340
|
}
|
|
317
341
|
};
|
|
318
342
|
}
|
|
@@ -320,7 +344,7 @@ export class FacialRecognitionConfigurationBuilder {
|
|
|
320
344
|
|
|
321
345
|
|
|
322
346
|
export class FacialRecognitionConfiguration {
|
|
323
|
-
constructor(enrollFace, scanMinimumMatchLevel, readMinimumMatchLevel, lookupMinimumMatchLevel, maxAttempts,isAllowClosedEyes,obfuscationType,isOneToNVerificationEnabled) {
|
|
347
|
+
constructor(enrollFace, scanMinimumMatchLevel, readMinimumMatchLevel, lookupMinimumMatchLevel, maxAttempts,isAllowClosedEyes,obfuscationType,isOneToNVerificationEnabled,enableActiveLiveness,disableLivenessGesture) {
|
|
324
348
|
this.enrollFace = enrollFace;
|
|
325
349
|
this.scanMinimumMatchLevel = scanMinimumMatchLevel;
|
|
326
350
|
this.readMinimumMatchLevel = readMinimumMatchLevel;
|
|
@@ -329,6 +353,8 @@ export class FacialRecognitionConfiguration {
|
|
|
329
353
|
this.allowClosedEyes = isAllowClosedEyes;
|
|
330
354
|
this.obfuscationType = obfuscationType;
|
|
331
355
|
this.isOneToNVerificationEnabled = isOneToNVerificationEnabled;
|
|
356
|
+
this.enableActiveLiveness = enableActiveLiveness;
|
|
357
|
+
this.disableLivenessGesture = disableLivenessGesture;
|
|
332
358
|
}
|
|
333
359
|
}
|
|
334
360
|
|
|
@@ -688,16 +714,23 @@ export class FaceSessionBuilder {
|
|
|
688
714
|
return this;
|
|
689
715
|
},
|
|
690
716
|
|
|
717
|
+
enableActiveLiveness: function (gesture) {
|
|
718
|
+
this.enableActiveLiveness = true;
|
|
719
|
+
if (gesture) {
|
|
720
|
+
this.disableLivenessGesture = gesture;
|
|
721
|
+
}
|
|
722
|
+
return this;
|
|
723
|
+
},
|
|
691
724
|
|
|
692
725
|
build: function () {
|
|
693
|
-
return new FaceSessionConfiguration(this.authorizationToken, this.sessionId, this.nonce, this.userIdentifier, this.isRootedDeviceAllowed, this.isSecuredWindowsDisabled, this.minimumMatchLevel, this.maxAttempts, this.isReturnDataForIncompleteSession, this.appearanceMode,this.isAllowClosedEyes,this.obfuscationType);
|
|
726
|
+
return new FaceSessionConfiguration(this.authorizationToken, this.sessionId, this.nonce, this.userIdentifier, this.isRootedDeviceAllowed, this.isSecuredWindowsDisabled, this.minimumMatchLevel, this.maxAttempts, this.isReturnDataForIncompleteSession, this.appearanceMode,this.isAllowClosedEyes,this.obfuscationType,this.enableActiveLiveness,this.disableLivenessGesture);
|
|
694
727
|
}
|
|
695
728
|
}
|
|
696
729
|
}
|
|
697
730
|
}
|
|
698
731
|
|
|
699
732
|
export class FaceSessionConfiguration {
|
|
700
|
-
constructor(token, sessionId, nonce, userIdentifier, isRootedDeviceAllowed, isSecuredWindowsDisabled, minimumMatchLevel,maxAttempts,isReturnDataForIncompleteSession,appearanceMode,isAllowClosedEyes,obfuscationType) {
|
|
733
|
+
constructor(token, sessionId, nonce, userIdentifier, isRootedDeviceAllowed, isSecuredWindowsDisabled, minimumMatchLevel,maxAttempts,isReturnDataForIncompleteSession,appearanceMode,isAllowClosedEyes,obfuscationType,enableActiveLiveness,disableLivenessGesture) {
|
|
701
734
|
this.token = token;
|
|
702
735
|
this.sessionId = sessionId;
|
|
703
736
|
this.nonce = nonce;
|
|
@@ -710,6 +743,8 @@ export class FaceSessionConfiguration {
|
|
|
710
743
|
this.appearanceMode = appearanceMode;
|
|
711
744
|
this.allowClosedEyes = isAllowClosedEyes;
|
|
712
745
|
this.obfuscationType = obfuscationType;
|
|
746
|
+
this.enableActiveLiveness = enableActiveLiveness;
|
|
747
|
+
this.disableLivenessGesture = disableLivenessGesture;
|
|
713
748
|
}
|
|
714
749
|
}
|
|
715
750
|
|
|
@@ -730,6 +765,122 @@ export class Lookup {
|
|
|
730
765
|
}
|
|
731
766
|
}
|
|
732
767
|
|
|
768
|
+
export class Reading {
|
|
769
|
+
constructor(authorizationToken, sessionId, userIdentifier, nonce, documentType,
|
|
770
|
+
documentNumber, dateOfBirth, dateOfExpiry, mrz, isReturnDataForIncompleteSession,
|
|
771
|
+
isSecuredWindowsDisabled, facialRecognitionSpecification, backgroundCheckConfiguration,
|
|
772
|
+
isLookupEnabled, appearanceMode) {
|
|
773
|
+
this.authorizationToken = authorizationToken;
|
|
774
|
+
this.sessionId = sessionId;
|
|
775
|
+
this.userIdentifier = userIdentifier;
|
|
776
|
+
this.nonce = nonce;
|
|
777
|
+
this.documentType = documentType;
|
|
778
|
+
this.documentNumber = documentNumber;
|
|
779
|
+
this.dateOfBirth = dateOfBirth;
|
|
780
|
+
this.dateOfExpiry = dateOfExpiry;
|
|
781
|
+
this.mrz = mrz;
|
|
782
|
+
this.isReturnDataForIncompleteSession = isReturnDataForIncompleteSession;
|
|
783
|
+
this.isSecuredWindowsDisabled = isSecuredWindowsDisabled;
|
|
784
|
+
this.facialRecognitionSpecification = facialRecognitionSpecification;
|
|
785
|
+
this.backgroundCheckConfiguration = backgroundCheckConfiguration;
|
|
786
|
+
this.isLookupEnabled = isLookupEnabled;
|
|
787
|
+
this.appearanceMode = appearanceMode;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
export class ReadingBuilder {
|
|
792
|
+
setToken(token) {
|
|
793
|
+
this.authorizationToken = token;
|
|
794
|
+
return this;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
setSessionId(sessionId) {
|
|
798
|
+
this.sessionId = sessionId;
|
|
799
|
+
return this;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
setUserIdentifier(userIdentifier) {
|
|
803
|
+
this.userIdentifier = userIdentifier;
|
|
804
|
+
return this;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
setNonce(nonce) {
|
|
808
|
+
this.nonce = nonce;
|
|
809
|
+
return this;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
setDocumentType(documentType) {
|
|
813
|
+
this.documentType = documentType;
|
|
814
|
+
return this;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
setDocumentNumber(documentNumber) {
|
|
818
|
+
this.documentNumber = documentNumber;
|
|
819
|
+
return this;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
setDateOfBirth(dateOfBirth) {
|
|
823
|
+
this.dateOfBirth = dateOfBirth;
|
|
824
|
+
return this;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
setDateOfExpiry(dateOfExpiry) {
|
|
828
|
+
this.dateOfExpiry = dateOfExpiry;
|
|
829
|
+
return this;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
setMrz(mrz) {
|
|
833
|
+
this.mrz = mrz;
|
|
834
|
+
return this;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
returnDataForIncompleteSession() {
|
|
838
|
+
this.isReturnDataForIncompleteSession = true;
|
|
839
|
+
return this;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
disableSecureWindow() {
|
|
843
|
+
this.isSecuredWindowsDisabled = true;
|
|
844
|
+
return this;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
enableFacialRecognition() {
|
|
848
|
+
if (arguments.length === 0) {
|
|
849
|
+
this.facialRecognitionSpecification = new FacialRecognitionConfigurationBuilder().build();
|
|
850
|
+
} else {
|
|
851
|
+
this.facialRecognitionSpecification = arguments[0];
|
|
852
|
+
}
|
|
853
|
+
return this;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
enableBackgroundCheck() {
|
|
857
|
+
if (arguments.length === 0) {
|
|
858
|
+
this.backgroundCheckConfiguration = new BackgroundCheckConfigurationBuilder().build();
|
|
859
|
+
} else {
|
|
860
|
+
this.backgroundCheckConfiguration = arguments[0];
|
|
861
|
+
}
|
|
862
|
+
return this;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
enableLookup() {
|
|
866
|
+
this.isLookupEnabled = true;
|
|
867
|
+
return this;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
setAppearanceMode(appearanceMode) {
|
|
871
|
+
this.appearanceMode = appearanceMode;
|
|
872
|
+
return this;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
build() {
|
|
876
|
+
return new Reading(this.authorizationToken, this.sessionId, this.userIdentifier, this.nonce,
|
|
877
|
+
this.documentType, this.documentNumber, this.dateOfBirth, this.dateOfExpiry, this.mrz,
|
|
878
|
+
this.isReturnDataForIncompleteSession, this.isSecuredWindowsDisabled,
|
|
879
|
+
this.facialRecognitionSpecification, this.backgroundCheckConfiguration,
|
|
880
|
+
this.isLookupEnabled, this.appearanceMode);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
733
884
|
export class LookupBuilder {
|
|
734
885
|
setToken(token) {
|
|
735
886
|
this.authorizationToken = token;
|