uqudosdk-react-native 2.6.0 → 2.7.0-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 CHANGED
@@ -1,3 +1,16 @@
1
+ ## 2.7.0-1
2
+
3
+ * Fixed syntax error in the DocumentType enum.
4
+
5
+ ## 2.7.0
6
+
7
+ * In this latest release, we've revamped the facial recognition step. We've eliminated the nodding step, transforming facial recognition into a straightforward process easy as capturing a selfie. Under the hood, numerous enhancements have been implemented to ensure speed, simplicity, and enhanced accuracy. There are no changes in terms of business logic for your integration process
8
+ * Within the iOS native SDK, we have marked several properties under UQEnrollmentBuilder and UQLookupBuilder associated with facial recognition as deprecated. In their place, we've introduced a dedicated entity called UQFacialRecognitionConfig. This entity serves to enable facial recognition and customize the corresponding settings. See the documentation for details
9
+ * We have added a new configuration option for facial recognition that allows closed eyes during facial recognition. By default is disabled. See the documentation for details
10
+ * Improved scanning for Bahrain ID
11
+ * Added support for Lebanon ID and Driving License
12
+ * Minor improvements and minor bug fixes
13
+
1
14
  ## 2.6.0
2
15
 
3
16
  * Added new feature "Lookup Flow". The "Lookp Flow" it's the same as the "Enrollment Flow" with the only difference that the first step is not the automatic scanning of a document through the camera phone but the user is asked to manually type in some information of the document that can be used to perform the lookup on the government database. Only one document at the time is supported. Other features like facial recognition and background check can be enabled in the same way as per the "Enrollment Flow". Please check the integration documentation https://docs.uqudo.com/docs/uqudo-sdk/integration for details
@@ -33,5 +33,5 @@ android {
33
33
 
34
34
  dependencies {
35
35
  implementation 'com.facebook.react:react-native:+'
36
- implementation 'io.uqudo.sdk:Uqudo:2.6.0'
36
+ implementation 'io.uqudo.sdk:Uqudo:2.7.0'
37
37
  }
@@ -147,7 +147,9 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
147
147
  if (faceObject.has("maxAttempts") && faceObject.getInt("maxAttempts") > 0) {
148
148
  faceBuilder.setMaxAttempts(faceObject.getInt("maxAttempts"));
149
149
  }
150
-
150
+ if (faceObject.has("allowClosedEyes") && faceObject.getBoolean("allowClosedEyes")) {
151
+ faceBuilder.allowClosedEyes();
152
+ }
151
153
  enrollment.enableFacialRecognition(faceBuilder.build());
152
154
  }
153
155
  if (json.has("lookupConfiguration")) {
@@ -280,6 +282,9 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
280
282
  if (json.has("maxAttempts") && json.getInt("maxAttempts") > 0) {
281
283
  recovery.setMaxAttempts(json.getInt("maxAttempts"));
282
284
  }
285
+ if (json.has("allowClosedEyes") && json.getBoolean("allowClosedEyes")) {
286
+ recovery.allowClosedEyes();
287
+ }
283
288
  if (json.has("isReturnDataForIncompleteSession") && json.getBoolean("isReturnDataForIncompleteSession")) {
284
289
  recovery.returnDataForIncompleteSession();
285
290
  }
@@ -327,6 +332,9 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
327
332
  if (json.has("maxAttempts") && json.getInt("maxAttempts") > 0) {
328
333
  faceSession.setMaxAttempts(json.getInt("maxAttempts"));
329
334
  }
335
+ if (json.has("allowClosedEyes") && json.getBoolean("allowClosedEyes")) {
336
+ faceSession.allowClosedEyes();
337
+ }
330
338
  if (json.has("isReturnDataForIncompleteSession") && json.getBoolean("isReturnDataForIncompleteSession")) {
331
339
  faceSession.returnDataForIncompleteSession();
332
340
  }
@@ -386,6 +394,9 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
386
394
  if (faceObject.has("maxAttempts") && faceObject.getInt("maxAttempts") > 0) {
387
395
  faceBuilder.setMaxAttempts(faceObject.getInt("maxAttempts"));
388
396
  }
397
+ if (faceObject.has("allowClosedEyes") && faceObject.getBoolean("allowClosedEyes")) {
398
+ faceBuilder.allowClosedEyes();
399
+ }
389
400
  lookupBuilder.enableFacialRecognition(faceBuilder.build());
390
401
  }
391
402
  if (json.has("backgroundCheckConfiguration")) {
package/ios/UqudoId.m CHANGED
@@ -60,26 +60,31 @@ RCT_EXPORT_METHOD(enroll:(NSString *)enrollObj resolver:(RCTPromiseResolveBlock)
60
60
  }
61
61
  if (facialRecognitionSpecification) {
62
62
  // Enable help page for face recognition
63
- enrollmentBuilder.enableFacialRecognition = TRUE;
63
+ UQFacialRecognitionConfig *config = [[UQFacialRecognitionConfig alloc] init];
64
+ config.enableFacialRecognition = YES;
64
65
 
65
66
  // Enable enroll face option
66
67
  if (facialRecognitionSpecification[@"enrollFace"]) {
67
- enrollmentBuilder.enrollFace = [[facialRecognitionSpecification valueForKey:@"enrollFace"] boolValue];
68
+ config.enrollFace = [[facialRecognitionSpecification valueForKey:@"enrollFace"] boolValue];
68
69
  }
69
70
 
70
71
  if (facialRecognitionSpecification[@"scanMinimumMatchLevel"]) {
71
- enrollmentBuilder.scanMinimumMatchLevel = [[facialRecognitionSpecification valueForKey:@"scanMinimumMatchLevel"] integerValue];
72
+ config.scanMinimumMatchLevel = [[facialRecognitionSpecification valueForKey:@"scanMinimumMatchLevel"] integerValue];
72
73
  }
73
74
 
74
75
  if (facialRecognitionSpecification[@"readMinimumMatchLevel"]) {
75
- enrollmentBuilder.readMinimumMatchLevel = [[facialRecognitionSpecification valueForKey:@"readMinimumMatchLevel"] integerValue];
76
+ config.readMinimumMatchLevel = [[facialRecognitionSpecification valueForKey:@"readMinimumMatchLevel"] integerValue];
76
77
  }
77
78
  if (facialRecognitionSpecification[@"maxAttempts"]) {
78
79
  int maxAttempts = [[facialRecognitionSpecification valueForKey:@"maxAttempts"] intValue];
79
80
  if (maxAttempts > 0) {
80
- enrollmentBuilder.facialRecognitionMaxAttempts = maxAttempts;
81
+ config.facialRecognitionMaxAttempts = maxAttempts;
81
82
  }
82
83
  }
84
+ if (facialRecognitionSpecification[@"allowClosedEyes"]) {
85
+ config.allowClosedEyes = [[facialRecognitionSpecification valueForKey:@"allowClosedEyes"] boolValue];
86
+ }
87
+ enrollmentBuilder.facialRecognitionConfig = config;
83
88
  }
84
89
 
85
90
  if(lookupConfiguration){
@@ -262,6 +267,10 @@ RCT_EXPORT_METHOD(recover:(NSString *)recoverObj resolver:(RCTPromiseResolveBloc
262
267
  }
263
268
  }
264
269
 
270
+ if (json[@"allowClosedEyes"]) {
271
+ accountRecoveryBuilder.allowClosedEyes = [[json valueForKey:@"allowClosedEyes"] boolValue];
272
+ }
273
+
265
274
  if (json[@"isReturnDataForIncompleteSession"]) {
266
275
  accountRecoveryBuilder.returnDataForIncompleteSession = [[json valueForKey:@"isReturnDataForIncompleteSession"] boolValue];
267
276
  }
@@ -339,6 +348,10 @@ RCT_EXPORT_METHOD(faceSession:(NSString *)configuration resolver:(RCTPromiseReso
339
348
  }
340
349
  }
341
350
 
351
+ if (json[@"allowClosedEyes"]) {
352
+ faceSessionBuilder.allowClosedEyes = [[json valueForKey:@"allowClosedEyes"] boolValue];
353
+ }
354
+
342
355
  if (json[@"isReturnDataForIncompleteSession"]) {
343
356
  faceSessionBuilder.returnDataForIncompleteSession = [[json valueForKey:@"isReturnDataForIncompleteSession"] boolValue];
344
357
  }
@@ -426,21 +439,28 @@ RCT_EXPORT_METHOD(lookup:(NSString *)lookupObj resolver:(RCTPromiseResolveBlock)
426
439
  }
427
440
  NSDictionary* facialRecognitionSpecification = json[@"facialRecognitionSpecification"];
428
441
  if (facialRecognitionSpecification) {
442
+
443
+ UQFacialRecognitionConfig *config = [[UQFacialRecognitionConfig alloc] init];
429
444
  // Enable help page for face recognition
430
- lookupBuilder.enableFacialRecognition = TRUE;
445
+ config.enableFacialRecognition = YES;
431
446
  // Enable enroll face option
432
447
  if (facialRecognitionSpecification[@"enrollFace"]) {
433
- lookupBuilder.enrollFace = [[facialRecognitionSpecification valueForKey:@"enrollFace"] boolValue];
448
+ config.enrollFace = [[facialRecognitionSpecification valueForKey:@"enrollFace"] boolValue];
434
449
  }
435
450
  if (facialRecognitionSpecification[@"lookupMinimumMatchLevel"]) {
436
- lookupBuilder.facialRecognitionMinimumMatchLevel = [[facialRecognitionSpecification valueForKey:@"lookupMinimumMatchLevel"] integerValue];
451
+ config.minimumMatchLevel = [[facialRecognitionSpecification valueForKey:@"lookupMinimumMatchLevel"] integerValue];
437
452
  }
438
453
  if (facialRecognitionSpecification[@"maxAttempts"]) {
439
454
  int maxAttempts = [[facialRecognitionSpecification valueForKey:@"maxAttempts"] intValue];
440
455
  if (maxAttempts > 0) {
441
- lookupBuilder.facialRecognitionMaxAttempts = maxAttempts;
456
+ config.maxAttempts = maxAttempts;
442
457
  }
443
458
  }
459
+ if (facialRecognitionSpecification[@"allowClosedEyes"]) {
460
+ config.allowClosedEyes = [[facialRecognitionSpecification valueForKey:@"allowClosedEyes"] boolValue];
461
+ }
462
+ lookupBuilder.facialRecognitionConfig = config;
463
+
444
464
  }
445
465
  NSDictionary* backgroundCheckConfiguration = json[@"backgroundCheckConfiguration"];
446
466
  if (backgroundCheckConfiguration) {
@@ -608,8 +628,8 @@ RCT_EXPORT_METHOD(isLookupFacialRecognitionSupported:(NSString *)documentType re
608
628
  case SESSION_INVALIDATED_FACE_RECOGNITION_TOO_MANY_ATTEMPTS:
609
629
  code = @"SESSION_INVALIDATED_FACE_RECOGNITION_TOO_MANY_ATTEMPTS";
610
630
  break;
611
- case SESSION_INVALIDATED_OTP_EXPIRED:
612
- code = @"SESSION_INVALIDATED_OTP_EXPIRED";
631
+ case SESSION_INVALIDATED_OTP_TOO_MANY_ATTEMPTS:
632
+ code = @"SESSION_INVALIDATED_OTP_TOO_MANY_ATTEMPTS";
613
633
  break;
614
634
  }
615
635
  NSString *task = nil;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "uqudosdk-react-native",
3
3
  "title": "React Native UqudoId",
4
- "version": "2.6.0",
4
+ "version": "2.7.0-1",
5
5
  "description": "Uqudo SDK react native module",
6
6
  "main": "index.js",
7
7
  "author": {
@@ -108,7 +108,9 @@ export const DocumentType = Object.freeze(
108
108
  IND_PAN: 'IND_PAN',
109
109
  SAU_ID_NATIONAL: 'SAU_ID_NATIONAL',
110
110
  SAU_ID_RESIDENT: 'SAU_ID_RESIDENT',
111
- NGA_BVN: 'NGA_BVN'
111
+ NGA_BVN: 'NGA_BVN',
112
+ LBN_ID: 'LBN_ID',
113
+ LBN_DL: 'LBN_DL',
112
114
  }
113
115
  );
114
116
 
@@ -260,8 +262,13 @@ export class FacialRecognitionConfigurationBuilder {
260
262
  return this;
261
263
  },
262
264
 
265
+ allowClosedEyes: function () {
266
+ this.isAllowClosedEyes = true;
267
+ return this;
268
+ },
269
+
263
270
  build: function () {
264
- return new FacialRecognitionConfiguration(this.enrollFace, this.scanMinimumMatchLevel, this.readMinimumMatchLevel, this.lookupMinimumMatchLevel, this.maxAttempts);
271
+ return new FacialRecognitionConfiguration(this.enrollFace, this.scanMinimumMatchLevel, this.readMinimumMatchLevel, this.lookupMinimumMatchLevel, this.maxAttempts,this.isAllowClosedEyes);
265
272
  }
266
273
  };
267
274
  }
@@ -269,12 +276,13 @@ export class FacialRecognitionConfigurationBuilder {
269
276
 
270
277
 
271
278
  export class FacialRecognitionConfiguration {
272
- constructor(enrollFace, scanMinimumMatchLevel, readMinimumMatchLevel, lookupMinimumMatchLevel, maxAttempts) {
279
+ constructor(enrollFace, scanMinimumMatchLevel, readMinimumMatchLevel, lookupMinimumMatchLevel, maxAttempts,isAllowClosedEyes) {
273
280
  this.enrollFace = enrollFace;
274
281
  this.scanMinimumMatchLevel = scanMinimumMatchLevel;
275
282
  this.readMinimumMatchLevel = readMinimumMatchLevel;
276
283
  this.lookupMinimumMatchLevel = lookupMinimumMatchLevel;
277
284
  this.maxAttempts = maxAttempts;
285
+ this.allowClosedEyes = isAllowClosedEyes;
278
286
  }
279
287
  }
280
288
 
@@ -331,6 +339,7 @@ export class BackgroundCheckConfiguration {
331
339
 
332
340
  export class DocumentBuilder {
333
341
  constructor() {
342
+
334
343
  return {
335
344
  setDocumentType: function (documentType) {
336
345
  this.documentType = documentType;
@@ -418,6 +427,7 @@ export class ReadingConfigurationBuilder {
418
427
  this.forceReadingValue = false;
419
428
  this.forceReadingIfSupportedValue = false;
420
429
  this.timeoutInSeconds = -1;
430
+
421
431
  return {
422
432
  forceReading: function (value) {
423
433
  this.forceReadingValue = value;
@@ -471,6 +481,7 @@ export class Document {
471
481
 
472
482
  export class AccountRecoveryBuilder {
473
483
  constructor() {
484
+
474
485
  return {
475
486
  /**
476
487
  * Pass the token received from Uqudo to authenticate the SDK
@@ -526,6 +537,11 @@ export class AccountRecoveryBuilder {
526
537
  return this;
527
538
  },
528
539
 
540
+ allowClosedEyes: function () {
541
+ this.isAllowClosedEyes = true;
542
+ return this;
543
+ },
544
+
529
545
  returnDataForIncompleteSession: function () {
530
546
  this.isReturnDataForIncompleteSession = true;
531
547
  return this;
@@ -541,14 +557,14 @@ export class AccountRecoveryBuilder {
541
557
  * recover the account
542
558
  */
543
559
  build: function () {
544
- return new AccountRecoveryConfiguration(this.authorizationToken, this.enrollmentIdentifier, this.nonce, this.isRootedDeviceAllowed, this.isSecuredWindowsDisabled, this.minimumMatchLevel, this.maxAttempts, this.isReturnDataForIncompleteSession, this.appearanceMode);
560
+ return new AccountRecoveryConfiguration(this.authorizationToken, this.enrollmentIdentifier, this.nonce, this.isRootedDeviceAllowed, this.isSecuredWindowsDisabled, this.minimumMatchLevel, this.maxAttempts, this.isReturnDataForIncompleteSession, this.appearanceMode,this.isAllowClosedEyes);
545
561
  }
546
562
  }
547
563
  }
548
564
  }
549
565
 
550
566
  export class AccountRecoveryConfiguration {
551
- constructor(token, enrollmentIdentifier, nonce, isRootedDeviceAllowed, isSecuredWindowsDisabled, minimumMatchLevel,maxAttempts,isReturnDataForIncompleteSession,appearanceMode) {
567
+ constructor(token, enrollmentIdentifier, nonce, isRootedDeviceAllowed, isSecuredWindowsDisabled, minimumMatchLevel,maxAttempts,isReturnDataForIncompleteSession,appearanceMode,isAllowClosedEyes) {
552
568
  this.token = token;
553
569
  this.enrollmentIdentifier = enrollmentIdentifier;
554
570
  this.nonce = nonce;
@@ -558,11 +574,13 @@ export class AccountRecoveryConfiguration {
558
574
  this.maxAttempts = maxAttempts;
559
575
  this.isReturnDataForIncompleteSession = isReturnDataForIncompleteSession;
560
576
  this.appearanceMode = appearanceMode;
577
+ this.allowClosedEyes = isAllowClosedEyes;
561
578
  }
562
579
  }
563
580
 
564
581
  export class FaceSessionBuilder {
565
582
  constructor() {
583
+
566
584
  return {
567
585
  setToken: function (token) {
568
586
  this.authorizationToken = token;
@@ -599,6 +617,11 @@ export class FaceSessionBuilder {
599
617
  return this;
600
618
  },
601
619
 
620
+ allowClosedEyes: function () {
621
+ this.isAllowClosedEyes = true;
622
+ return this;
623
+ },
624
+
602
625
  returnDataForIncompleteSession: function () {
603
626
  this.isReturnDataForIncompleteSession = true;
604
627
  return this;
@@ -611,14 +634,14 @@ export class FaceSessionBuilder {
611
634
 
612
635
 
613
636
  build: function () {
614
- return new FaceSessionConfiguration(this.authorizationToken, this.sessionId, this.nonce, this.isRootedDeviceAllowed, this.isSecuredWindowsDisabled, this.minimumMatchLevel, this.maxAttempts, this.isReturnDataForIncompleteSession, this.appearanceMode);
637
+ return new FaceSessionConfiguration(this.authorizationToken, this.sessionId, this.nonce, this.isRootedDeviceAllowed, this.isSecuredWindowsDisabled, this.minimumMatchLevel, this.maxAttempts, this.isReturnDataForIncompleteSession, this.appearanceMode,this.isAllowClosedEyes);
615
638
  }
616
639
  }
617
640
  }
618
641
  }
619
642
 
620
643
  export class FaceSessionConfiguration {
621
- constructor(token, sessionId, nonce, isRootedDeviceAllowed, isSecuredWindowsDisabled, minimumMatchLevel,maxAttempts,isReturnDataForIncompleteSession,appearanceMode) {
644
+ constructor(token, sessionId, nonce, isRootedDeviceAllowed, isSecuredWindowsDisabled, minimumMatchLevel,maxAttempts,isReturnDataForIncompleteSession,appearanceMode,isAllowClosedEyes) {
622
645
  this.token = token;
623
646
  this.sessionId = sessionId;
624
647
  this.nonce = nonce;
@@ -628,7 +651,7 @@ export class FaceSessionConfiguration {
628
651
  this.maxAttempts = maxAttempts;
629
652
  this.isReturnDataForIncompleteSession = isReturnDataForIncompleteSession;
630
653
  this.appearanceMode = appearanceMode;
631
-
654
+ this.allowClosedEyes = isAllowClosedEyes;
632
655
  }
633
656
  }
634
657
 
@@ -13,5 +13,5 @@ Pod::Spec.new do |s|
13
13
  s.source = { :http => 'https://uqudo.com' }
14
14
  s.header_dir = 'UqudoSDK'
15
15
  s.dependency 'React'
16
- s.dependency 'UqudoSDK', '2.6.0'
16
+ s.dependency 'UqudoSDK', '2.7.0'
17
17
  end