uqudosdk-react-native 2.2.1 → 2.3.0

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,13 @@
1
+ ## 2.3.0
2
+
3
+ * Added new document type DZA_ID (Algerian ID)
4
+ * Added new document type TUR_ID (Turkish ID)
5
+ * Added NFC support for Algerian ID
6
+ * Added NFC support for Turkish ID
7
+ * Improved quality detection during the scanning of the document
8
+ * Deprecated enableRootedDeviceUsage(), it is ignored from this version and no rooted device is allowed
9
+ * Minor bug fixes and improvements
10
+
1
11
  ## 2.2.1
2
12
 
3
13
  * Minor bug fixes
@@ -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.2.1'
36
+ implementation 'io.uqudo.sdk:Uqudo:2.3.0'
37
37
  }
@@ -354,6 +354,24 @@ public class UqudoIdModule extends ReactContextBaseJavaModule implements Activit
354
354
  }
355
355
  }
356
356
 
357
+ @ReactMethod
358
+ public void isReadingSupported(String documentType, Promise promise) {
359
+ try {
360
+ promise.resolve(DocumentType.valueOf(documentType).getReadingSupported());
361
+ } catch (Exception e) {
362
+ sendError(promise, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected document type as argument", null);
363
+ }
364
+ }
365
+
366
+ @ReactMethod
367
+ public void isFacialRecognitionSupported(String documentType, Promise promise) {
368
+ try {
369
+ promise.resolve(DocumentType.valueOf(documentType).getFacialRecognitionSupported());
370
+ } catch (Exception e) {
371
+ sendError(promise, SessionStatusCode.UNEXPECTED_ERROR.name(), "Expected document type as argument.", null);
372
+ }
373
+ }
374
+
357
375
  private void sendError(Promise promise, String code, String message, String task) {
358
376
  sendError(promise, code, message, task, null);
359
377
  }
package/ios/UqudoId.m CHANGED
@@ -156,7 +156,6 @@ RCT_EXPORT_METHOD(enroll:(NSString *)enrollObj resolver:(RCTPromiseResolveBlock)
156
156
  }
157
157
 
158
158
  if (document[@"readingConfiguration"]) {
159
- if (@available(iOS 13, *)) {
160
159
  NSDictionary *readingConfiguration = document[@"readingConfiguration"];
161
160
 
162
161
  UQReadingConfig *readConfig = [[UQReadingConfig alloc] init];
@@ -178,7 +177,6 @@ RCT_EXPORT_METHOD(enroll:(NSString *)enrollObj resolver:(RCTPromiseResolveBlock)
178
177
  }
179
178
 
180
179
  documentObject.reading = readConfig;
181
- }
182
180
  }
183
181
 
184
182
  [enrollmentBuilder add:documentObject];
@@ -420,6 +418,34 @@ RCT_EXPORT_METHOD(faceSession:(NSString *)configuration resolver:(RCTPromiseReso
420
418
  [self sendPluginError:status];
421
419
  }
422
420
 
421
+ RCT_EXPORT_METHOD(isReadingSupported:(NSString *)documentType resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
422
+ @try{
423
+ UQDocumentConfig *documentObject = [[UQDocumentConfig alloc] initWithDocumentTypeName:documentType];
424
+ resolve(@(documentObject.isSupportReading));
425
+ }
426
+ @catch (NSException *exception) {
427
+ UQSessionStatus *status =[[UQSessionStatus alloc] init];
428
+ status.statusCode = UNEXPECTED_ERROR;
429
+ status.message = @"Expected document type as argument.";
430
+ status.statusTask = -1;
431
+ [self sendPluginError:status];
432
+ }
433
+ }
434
+
435
+ RCT_EXPORT_METHOD(isFacialRecognitionSupported:(NSString *)documentType resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
436
+ @try{
437
+ UQDocumentConfig *documentObject = [[UQDocumentConfig alloc] initWithDocumentTypeName:documentType];
438
+ resolve(@(documentObject.isSupportFaceRecognition));
439
+ }
440
+ @catch (NSException *exception) {
441
+ UQSessionStatus *status =[[UQSessionStatus alloc] init];
442
+ status.statusCode = UNEXPECTED_ERROR;
443
+ status.message = @"Expected document type as argument.";
444
+ status.statusTask = -1;
445
+ [self sendPluginError:status];
446
+ }
447
+ }
448
+
423
449
  - (void)sendPluginError:(UQSessionStatus *)status {
424
450
  NSString *code = nil;
425
451
  switch (status.statusCode) {
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.2.1",
4
+ "version": "2.3.0",
5
5
  "description": "Uqudo SDK react native module",
6
6
  "main": "index.js",
7
7
  "author": {
@@ -12,22 +12,29 @@ export class UqudoIdSDK {
12
12
  }
13
13
 
14
14
  async enroll(enrollmentConfiguration) {
15
- console.log(JSON.stringify(enrollmentConfiguration));
16
15
  var result = await NativeModules.UqudoId.enroll(JSON.stringify(enrollmentConfiguration));
17
16
  return result;
18
17
  }
19
18
 
20
19
  async recover(accountRecoveryConfiguration) {
21
- console.log(JSON.stringify(accountRecoveryConfiguration));
22
20
  var result = await NativeModules.UqudoId.recover(JSON.stringify(accountRecoveryConfiguration));
23
21
  return result;
24
22
  }
25
23
 
26
24
  async faceSession(faceSessionConfiguration) {
27
- console.log(JSON.stringify(faceSessionConfiguration));
28
25
  var result = await NativeModules.UqudoId.faceSession(JSON.stringify(faceSessionConfiguration));
29
26
  return result;
30
27
  }
28
+
29
+ async isFacialRecognitionSupported(documentType) {
30
+ var result = await NativeModules.UqudoId.isFacialRecognitionSupported(documentType);
31
+ return result;
32
+ }
33
+
34
+ async isReadingSupported(documentType) {
35
+ var result = await NativeModules.UqudoId.isReadingSupported(documentType);
36
+ return result;
37
+ }
31
38
  }
32
39
 
33
40
  export const DocumentType = Object.freeze(
@@ -68,7 +75,9 @@ export const DocumentType = Object.freeze(
68
75
  OMN_ID_NATIONAL: 'OMN_ID_NATIONAL',
69
76
  OMN_ID_RESIDENT: 'OMN_ID_RESIDENT',
70
77
  SEN_ID: 'SEN_ID',
71
- UGA_VOTER_ID: 'UGA_VOTER_ID'
78
+ UGA_VOTER_ID: 'UGA_VOTER_ID',
79
+ DZA_ID: 'DZA_ID',
80
+ TUR_ID: 'TUR_ID'
72
81
  }
73
82
  );
74
83
 
@@ -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.2.1'
16
+ s.dependency 'UqudoSDK', '2.3.0'
17
17
  end