@regulaforensics/react-native-document-reader-api 6.3.1 → 6.4.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.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Create a report to help us improve
4
+ title: "[BR] "
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Before Submitting, be sure to**
11
+ - [ ] Update to the latest stable version.
12
+ - [ ] Read and follow the guides described in the [documentation](https://docs.regulaforensics.com?utm_source=github).
13
+ - [ ] Try to reproduce in our demo project.
14
+ - [ ] Search for your issue in the existing GitHub issues.
15
+
16
+ **Bug Description**
17
+ <!--A clear and concise description of what the bug is.-->
18
+
19
+ **Steps To Reproduce**
20
+ <!--
21
+ 1. Go to '...'
22
+ 2. Click on '....'
23
+ 3. Scroll down to '....'
24
+ 4. See error
25
+ -->
26
+
27
+ **Expected behavior**
28
+ <!--A clear and concise description of what you expected to happen.-->
29
+
30
+ **Screenshots**
31
+ <!--If applicable, add screenshots to help explain your issue.-->
32
+
33
+ **Environment:**
34
+ - Device: <!--[e.g. iPhone 12]-->
35
+ - OS: <!--[e.g. iOS]-->
36
+ - OS version: <!--[e.g. 10.0]-->
37
+
38
+ **Additional context**
39
+ <!--Add any other context about the problem here.-->
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Regula Help Center
4
+ url: https://support.regulaforensics.com/hc/requests/new?utm_source=github
5
+ about: Please submit any requests here
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest an idea for this product
4
+ title: "[FR] "
5
+ labels: enhancement
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ <!--A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]-->
12
+
13
+ **Describe the solution you'd like**
14
+ <!--A clear and concise description of what you want to happen.-->
15
+
16
+ **Describe alternatives you've considered**
17
+ <!--A clear and concise description of any alternative solutions or features you've considered.-->
18
+
19
+ **Additional context**
20
+ <!--Add any other context or screenshots about the feature request here.-->
@@ -14,6 +14,6 @@ Pod::Spec.new do |s|
14
14
  s.source = { :http => 'file:' + __dir__ }
15
15
  s.ios.deployment_target = '11.0'
16
16
  s.source_files = "ios/*.{h,m}"
17
- s.dependency 'DocumentReader', '6.3.2494'
17
+ s.dependency 'DocumentReader', '6.4.2552'
18
18
  s.dependency 'React'
19
19
  end
@@ -49,7 +49,7 @@ dependencies {
49
49
  //noinspection GradleDynamicVersion
50
50
  implementation 'com.facebook.react:react-native:+'
51
51
  //noinspection GradleDependency
52
- implementation('com.regula.documentreader:api:6.3.6946') {
52
+ implementation('com.regula.documentreader:api:6.4.7224') {
53
53
  transitive = true
54
54
  }
55
55
  }
@@ -16,6 +16,7 @@ import com.regula.documentreader.api.enums.eRPRM_Lights;
16
16
  import com.regula.documentreader.api.errors.DocumentReaderException;
17
17
  import com.regula.documentreader.api.internal.core.CoreDetailedScenario;
18
18
  import com.regula.documentreader.api.params.FaceMetaData;
19
+ import com.regula.documentreader.api.params.ImageInputData;
19
20
  import com.regula.documentreader.api.params.rfid.TccParams;
20
21
  import com.regula.documentreader.api.params.rfid.authorization.PAAttribute;
21
22
  import com.regula.documentreader.api.params.rfid.authorization.PAResourcesIssuer;
@@ -360,6 +361,42 @@ class JSONConstructor {
360
361
  return result;
361
362
  }
362
363
 
364
+ static ImageInputData ImageInputDataFromJSON(JSONObject input) {
365
+ ImageInputData result = new ImageInputData(null);
366
+ int pageIndex = 0;
367
+ int light = 6;
368
+ int type = 254;
369
+ int width = 0;
370
+ int height = 0;
371
+ Bitmap bitmap;
372
+ byte[] imgBytes;
373
+
374
+ try {
375
+ if(input.has("pageIndex"))
376
+ pageIndex = input.optInt("pageIndex");
377
+ if(input.has("light"))
378
+ pageIndex = input.optInt("light");
379
+ if(input.has("type"))
380
+ pageIndex = input.optInt("type");
381
+ if (input.has("bitmap")) {
382
+ bitmap = Helpers.bitmapFromBase64(input.getString("bitmap"));
383
+ result = new ImageInputData(bitmap, light, pageIndex);
384
+ }
385
+ if (input.has("imgBytes")) {
386
+ JSONArray jsonArray_data = input.getJSONArray("data");
387
+ byte[] data = new byte[jsonArray_data.length()];
388
+ for (int i = 0; i < jsonArray_data.length(); i++)
389
+ data[i] = (byte) jsonArray_data.get(i);
390
+ imgBytes = data;
391
+ result = new ImageInputData(imgBytes, width, height, light, pageIndex);
392
+ }
393
+ } catch (JSONException e) {
394
+ e.printStackTrace();
395
+ }
396
+
397
+ return result;
398
+ }
399
+
363
400
  static Throwable ThrowableFromJSON(JSONObject jsonObject) {
364
401
  return new Throwable();
365
402
  }
@@ -1184,6 +1221,23 @@ class JSONConstructor {
1184
1221
  return result;
1185
1222
  }
1186
1223
 
1224
+ static JSONObject generateImageInputData(ImageInputData input) {
1225
+ JSONObject result = new JSONObject();
1226
+ if (input == null) return result;
1227
+ try {
1228
+ result.put("pageIndex", input.getPageIndex());
1229
+ result.put("light", input.getLight());
1230
+ result.put("type", input.getType());
1231
+ result.put("width", input.getWidth());
1232
+ result.put("height", input.getHeight());
1233
+ result.put("bitmap", generateBitmap(input.getBitmap()));
1234
+ result.put("imgBytes", generateByteArray(input.getImgBytes()));
1235
+ } catch (JSONException e) {
1236
+ e.printStackTrace();
1237
+ }
1238
+ return result;
1239
+ }
1240
+
1187
1241
  static JSONObject generateDocumentReaderResults(DocumentReaderResults input, Context context) {
1188
1242
  JSONObject result = new JSONObject();
1189
1243
  if (input == null) return result;
@@ -33,6 +33,7 @@ import com.regula.documentreader.api.enums.DocReaderAction;
33
33
  import com.regula.documentreader.api.errors.DocumentReaderException;
34
34
  import com.regula.documentreader.api.internal.core.CoreScenarioUtil;
35
35
  import com.regula.documentreader.api.params.DocReaderConfig;
36
+ import com.regula.documentreader.api.params.ImageInputData;
36
37
  import com.regula.documentreader.api.params.ImageInputParam;
37
38
  import com.regula.documentreader.api.params.rfid.PKDCertificate;
38
39
  import com.regula.documentreader.api.params.rfid.authorization.PAResourcesIssuer;
@@ -253,6 +254,9 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
253
254
  case "stopRFIDReader":
254
255
  stopRFIDReader(callback);
255
256
  break;
257
+ case "stopRFIDReaderWithErrorMessage":
258
+ stopRFIDReaderWithErrorMessage(callback, args(0));
259
+ break;
256
260
  case "stopScanner":
257
261
  stopScanner(callback);
258
262
  break;
@@ -358,9 +362,6 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
358
362
  case "initializeReaderWithDatabase":
359
363
  initializeReaderWithDatabase(callback, args(0), args(1));
360
364
  break;
361
- case "recognizeImageFrame":
362
- recognizeImageFrame(callback, args(0), args(1));
363
- break;
364
365
  case "recognizeImageWithOpts":
365
366
  recognizeImageWithOpts(callback, args(0), args(1));
366
367
  break;
@@ -370,12 +371,12 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
370
371
  case "showScannerWithCameraIDAndOpts":
371
372
  showScannerWithCameraIDAndOpts(callback, args(0), args(1));
372
373
  break;
373
- case "recognizeImageWithImageInputParams":
374
- recognizeImageWithImageInputParams(callback, args(0), args(1));
375
- break;
376
374
  case "recognizeImageWithCameraMode":
377
375
  recognizeImageWithCameraMode(callback, args(0), args(1));
378
376
  break;
377
+ case "recognizeImagesWithImageInputs":
378
+ recognizeImagesWithImageInputs(callback, args(0));
379
+ break;
379
380
  }
380
381
  } catch (Exception ignored) {
381
382
  }
@@ -548,10 +549,6 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
548
549
  callback.success();
549
550
  }
550
551
 
551
- private void recognizeImageWithImageInputParams(@SuppressWarnings("unused") Callback callback, String base64Image, final JSONObject params) throws JSONException {
552
- Instance().recognizeImage(Helpers.bitmapFromBase64(base64Image), new ImageInputParam(params.getInt("width"), params.getInt("height"), params.getInt("type")), getCompletion());
553
- }
554
-
555
552
  private void recognizeImageWithOpts(Callback callback, String base64Image, final JSONObject opts) throws JSONException {
556
553
  RegulaConfig.setConfig(Instance(), opts, getContext());
557
554
  recognizeImage(callback, base64Image);
@@ -570,6 +567,14 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
570
567
  Instance().recognizeImages(images, getCompletion());
571
568
  }
572
569
 
570
+ private void recognizeImagesWithImageInputs(@SuppressWarnings("unused") Callback callback, JSONArray base64Images) throws JSONException {
571
+ stopBackgroundRFID();
572
+ ImageInputData[] images = new ImageInputData[base64Images.length()];
573
+ for (int i = 0; i < images.length; i++)
574
+ images[i] = JSONConstructor.ImageInputDataFromJSON(base64Images.getJSONObject(i));
575
+ Instance().recognizeImages(images, getCompletion());
576
+ }
577
+
573
578
  private void removeDatabase(Callback callback) {
574
579
  callback.success(Instance().removeDatabase(getContext()));
575
580
  }
@@ -603,10 +608,6 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
603
608
  callback.success();
604
609
  }
605
610
 
606
- private void recognizeImageFrame(@SuppressWarnings("unused") Callback callback, String base64Image, final JSONObject opts) throws JSONException {
607
- Instance().recognizeImageFrame(Helpers.bitmapFromBase64(base64Image), new ImageInputParam(opts.getInt("width"), opts.getInt("height"), opts.getInt("type")), getCompletion());
608
- }
609
-
610
611
  private void recognizeVideoFrame(@SuppressWarnings("unused") Callback callback, String byteString, final JSONObject opts) throws JSONException {
611
612
  stopBackgroundRFID();
612
613
  Instance().recognizeVideoFrame(byteString.getBytes(), new ImageInputParam(opts.getInt("width"), opts.getInt("height"), opts.getInt("type")), getCompletion());
@@ -725,6 +726,10 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
725
726
  callback.error("getCameraSessionIsPaused() is an ios-only method");
726
727
  }
727
728
 
729
+ private void stopRFIDReaderWithErrorMessage(Callback callback, String message) {
730
+ callback.error("stopRFIDReaderWithErrorMessage() is an ios-only method");
731
+ }
732
+
728
733
  @SuppressWarnings("unused")
729
734
  private void recognizeImageWithCameraMode(Callback callback, String base64, boolean mode) {
730
735
  callback.error("recognizeImageWithCameraMode() is an ios-only method");
@@ -103,6 +103,8 @@ class RegulaConfig {
103
103
  editor.setManualMultipageMode(opts.getBoolean("manualMultipageMode"));
104
104
  if (opts.has("exposure"))
105
105
  editor.setExposure(BigDecimal.valueOf(opts.getDouble("exposure")).floatValue());
106
+ if (opts.has("rfidTimeout"))
107
+ editor.setRfidTimeout(opts.getInt("rfidTimeout"));
106
108
 
107
109
  editor.apply();
108
110
  }
@@ -331,6 +333,8 @@ class RegulaConfig {
331
333
  editor.setHologramAnimationImageMatrix(matrixFromFloatArray(floatArrayFromJson(opts.getJSONArray("hologramAnimationImageMatrix"))));
332
334
  if (opts.has("hologramAnimationImageScaleType"))
333
335
  editor.setHologramAnimationImageScaleType(ScaleType.valueOf(opts.getString("hologramAnimationImageScaleType")));
336
+ if (opts.has("uiCustomizationLayer"))
337
+ editor.setUiCustomizationLayer(opts.getJSONObject("uiCustomizationLayer"));
334
338
 
335
339
  editor.applyImmediately(context);
336
340
  }
@@ -371,6 +375,7 @@ class RegulaConfig {
371
375
  object.put("recordScanningProcess", functionality.doRecordProcessingVideo());
372
376
  object.put("manualMultipageMode", functionality.isManualMultipageMode());
373
377
  object.put("exposure", functionality.getExposure());
378
+ object.put("rfidTimeout", functionality.getRfidTimeout());
374
379
 
375
380
  return object;
376
381
  }
@@ -435,6 +440,7 @@ class RegulaConfig {
435
440
  object.put("hologramAnimationPositionMultiplier", customization.getHologramAnimationPositionMultiplier());
436
441
  object.put("hologramAnimationImageMatrix", customization.getHologramAnimationImageMatrix());
437
442
  object.put("hologramAnimationImageScaleType", customization.getHologramAnimationImageScaleType());
443
+ object.put("uiCustomizationLayer", customization.getUiCustomizationLayer());
438
444
 
439
445
  return object;
440
446
  }
@@ -10,8 +10,8 @@
10
10
  "lint": "eslint ."
11
11
  },
12
12
  "dependencies": {
13
- "@regulaforensics/react-native-document-reader-api": "^6.3.1",
14
- "@regulaforensics/react-native-document-reader-core-fullrfid": "^6.3.0",
13
+ "@regulaforensics/react-native-document-reader-api": "^6.4.0",
14
+ "@regulaforensics/react-native-document-reader-core-fullrfid": "^6.4.0",
15
15
  "react": "17.0.2",
16
16
  "react-native": "^0.67.0",
17
17
  "react-native-check-box": "^2.1.7",
package/index.d.ts CHANGED
@@ -1422,6 +1422,36 @@ export class DocumentReaderUvFiberElement {
1422
1422
  }
1423
1423
  }
1424
1424
 
1425
+ export class ImageInputData {
1426
+ pageIndex?: number
1427
+ light?: number
1428
+ type?: number
1429
+ width?: number
1430
+ height?: number
1431
+ bitmap?: string
1432
+ imgBytes?: any[]
1433
+
1434
+ static fromJson(jsonObject?: any): ImageInputData {
1435
+ if (jsonObject == null) return null
1436
+ const result = new ImageInputData
1437
+
1438
+ result.pageIndex = jsonObject["pageIndex"]
1439
+ result.light = jsonObject["light"]
1440
+ result.type = jsonObject["type"]
1441
+ result.width = jsonObject["width"]
1442
+ result.height = jsonObject["height"]
1443
+ result.bitmap = jsonObject["bitmap"]
1444
+ result.imgBytes = []
1445
+ if (jsonObject["imgBytes"] != null) {
1446
+ for (const i in jsonObject["imgBytes"]) {
1447
+ result.imgBytes.push(jsonObject["imgBytes"][i])
1448
+ }
1449
+ }
1450
+
1451
+ return result
1452
+ }
1453
+ }
1454
+
1425
1455
  export class DocumentReaderResults {
1426
1456
  chipPage?: number
1427
1457
  overallResult?: number
@@ -1694,13 +1724,13 @@ export const diDocType = {
1694
1724
  dtIdentityCard: 12,
1695
1725
  dtDiplomaticPassport: 13,
1696
1726
  dtServicePassport: 14,
1697
- dtSeamansIdentityDocument: 15,
1698
- dtIdentityCardforResidence: 16,
1699
- dtTraveldocument: 17,
1727
+ dtSeamanIdentityDocument: 15,
1728
+ dtIdentityCardForResidence: 16,
1729
+ dtTravelDocument: 17,
1700
1730
  dtOther: 99,
1701
1731
  dtVisaID2: 29,
1702
1732
  dtVisaID3: 30,
1703
- dtRegistrationCertificate: 31,
1733
+ dtRegistrationCertificate: 206,
1704
1734
  dtNationalIdentityCard: 20,
1705
1735
  dtSocialIdentityCard: 21,
1706
1736
  dtAliensIdentityCard: 22,
@@ -1717,10 +1747,10 @@ export const diDocType = {
1717
1747
  dtChauffeurLicenseUnder18: 36,
1718
1748
  dtChauffeurLicenseUnder21: 37,
1719
1749
  dtCommercialDrivingLicense: 38,
1720
- dtCommercialDrivingLicenseIndtuctionalPermit: 39,
1750
+ dtCommercialDrivingLicenseInstructionalPermit: 39,
1721
1751
  dtCommercialDrivingLicenseUnder18: 40,
1722
1752
  dtCommercialDrivingLicenseUnder21: 41,
1723
- dtCommercialIndtuctionPermit: 42,
1753
+ dtCommercialInstructionPermit: 42,
1724
1754
  dtCommercialNewPermit: 43,
1725
1755
  dtConcealedCarryLicense: 44,
1726
1756
  dtConcealedFirearmPermit: 45,
@@ -1728,9 +1758,9 @@ export const diDocType = {
1728
1758
  dtDepartmentOfVeteransAffairsIdentityCard: 47,
1729
1759
  dtDiplomaticDrivingLicense: 48,
1730
1760
  dtDrivingLicense: 49,
1731
- dtDrivingLicenseIndtuctionalPermit: 50,
1732
- dtDrivingLicenseIndtuctionalPermitUnder18: 51,
1733
- dtDrivingLicenseIndtuctionalPermitUnder21: 52,
1761
+ dtDrivingLicenseInstructionalPermit: 50,
1762
+ dtDrivingLicenseInstructionalPermitUnder18: 51,
1763
+ dtDrivingLicenseInstructionalPermitUnder21: 52,
1734
1764
  dtDrivingLicenseLearnersPermit: 53,
1735
1765
  dtDrivingLicenseLearnersPermitUnder18: 54,
1736
1766
  dtDrivingLicenseLearnersPermitUnder21: 55,
@@ -1738,8 +1768,8 @@ export const diDocType = {
1738
1768
  dtDrivingLicenseNoviceUnder18: 57,
1739
1769
  dtDrivingLicenseNoviceUnder21: 58,
1740
1770
  dtDrivingLicenseRegisteredOffender: 59,
1741
- dtDrivingLicenseRedtictedUnder18: 60,
1742
- dtDrivingLicenseRedtictedUnder21: 61,
1771
+ dtDrivingLicenseRestrictedUnder18: 60,
1772
+ dtDrivingLicenseRestrictedUnder21: 61,
1743
1773
  dtDrivingLicenseTemporaryVisitor: 62,
1744
1774
  dtDrivingLicenseTemporaryVisitorUnder18: 63,
1745
1775
  dtDrivingLicenseTemporaryVisitorUnder21: 64,
@@ -1764,8 +1794,8 @@ export const diDocType = {
1764
1794
  dtGenevaConventionsIdentityCard: 83,
1765
1795
  dtGraduatedDrivingLicenseUnder18: 84,
1766
1796
  dtGraduatedDrivingLicenseUnder21: 85,
1767
- dtGraduatedIndtuctionPermitUnder18: 86,
1768
- dtGraduatedIndtuctionPermitUnder21: 87,
1797
+ dtGraduatedInstructionPermitUnder18: 86,
1798
+ dtGraduatedInstructionPermitUnder21: 87,
1769
1799
  dtGraduatedLicenseUnder18: 88,
1770
1800
  dtGraduatedLicenseUnder21: 89,
1771
1801
  dtHandgunCarryPermit: 90,
@@ -1779,16 +1809,16 @@ export const diDocType = {
1779
1809
  dtIdentityCardUnder21: 98,
1780
1810
  dtIgnitionInterlockPermit: 100,
1781
1811
  dtImmigrantVisa: 101,
1782
- dtIndtuctionPermit: 102,
1783
- dtIndtuctionPermitUnder18: 103,
1784
- dtIndtuctionPermitUnder21: 104,
1812
+ dtInstructionPermit: 102,
1813
+ dtInstructionPermitUnder18: 103,
1814
+ dtInstructionPermitUnder21: 104,
1785
1815
  dtInterimDrivingLicense: 105,
1786
1816
  dtInterimIdentityCard: 106,
1787
1817
  dtIntermediateDrivingLicense: 107,
1788
1818
  dtIntermediateDrivingLicenseUnder18: 108,
1789
1819
  dtIntermediateDrivingLicenseUnder21: 109,
1790
1820
  dtJuniorDrivingLicense: 110,
1791
- dtLearnerIndtuctionalPermit: 111,
1821
+ dtLearnerInstructionalPermit: 111,
1792
1822
  dtLearnerLicense: 112,
1793
1823
  dtLearnerLicenseUnder18: 113,
1794
1824
  dtLearnerLicenseUnder21: 114,
@@ -1825,9 +1855,9 @@ export const diDocType = {
1825
1855
  dtRacingAndGamingComissionCard: 145,
1826
1856
  dtRefugeeTravelDocument: 146,
1827
1857
  dtRenewalPermit: 147,
1828
- dtRedtictedCommercialDrivingLicense: 148,
1829
- dtRedtictedDrivingLicense: 149,
1830
- dtRedtictedPermit: 150,
1858
+ dtRestrictedCommercialDrivingLicense: 148,
1859
+ dtRestrictedDrivingLicense: 149,
1860
+ dtRestrictedPermit: 150,
1831
1861
  dtSeasonalPermit: 151,
1832
1862
  dtSeasonalResidentIdentityCard: 152,
1833
1863
  dtSeniorCitizenIdentityCard: 153,
@@ -1837,9 +1867,9 @@ export const diDocType = {
1837
1867
  dtTemporaryDrivingLicenseUnder18: 157,
1838
1868
  dtTemporaryDrivingLicenseUnder21: 158,
1839
1869
  dtTemporaryIdentityCard: 159,
1840
- dtTemporaryIndtuctionPermitIdentityCard: 160,
1841
- dtTemporaryIndtuctionPermitIdentityCardUnder18: 161,
1842
- dtTemporaryIndtuctionPermitIdentityCardUnder21: 162,
1870
+ dtTemporaryInstructionPermitIdentityCard: 160,
1871
+ dtTemporaryInstructionPermitIdentityCardUnder18: 161,
1872
+ dtTemporaryInstructionPermitIdentityCardUnder21: 162,
1843
1873
  dtTemporaryVisitorDrivingLicense: 163,
1844
1874
  dtTemporaryVisitorDrivingLicenseUnder18: 164,
1845
1875
  dtTemporaryVisitorDrivingLicenseUnder21: 165,
@@ -1862,15 +1892,15 @@ export const diDocType = {
1862
1892
  dtCertificateOfCitizenship: 182,
1863
1893
  dtAddressCard: 183,
1864
1894
  dtAirportImmigrationCard: 184,
1865
- dtAlienRegidtationCard: 185,
1895
+ dtAlienRegistrationCard: 185,
1866
1896
  dtAPEHCard: 186,
1867
- dtCoupontoDrivingLicense: 187,
1897
+ dtCouponToDrivingLicense: 187,
1868
1898
  dtCrewMemberCertificate: 188,
1869
1899
  dtDocumentForReturn: 189,
1870
1900
  dtECard: 190,
1871
1901
  dtEmploymentCard: 191,
1872
1902
  dtHKSARImmigrationForm: 192,
1873
- dtImmigrantcard: 193,
1903
+ dtImmigrantCard: 193,
1874
1904
  dtLabourCard: 194,
1875
1905
  dtLaissezPasser: 195,
1876
1906
  dtLawyerIdentityCertificate: 196,
@@ -1882,7 +1912,7 @@ export const diDocType = {
1882
1912
  dtPassportOfficial: 202,
1883
1913
  dtPassportProvisional: 203,
1884
1914
  dtPassportSpecial: 204,
1885
- dtPermissiontotheLocalBorderTraffic: 205,
1915
+ dtPermissionToTheLocalBorderTraffic: 205,
1886
1916
  dtSEDESOLCard: 207,
1887
1917
  dtSocialCard: 208,
1888
1918
  dtTBCard: 209,
@@ -1915,6 +1945,10 @@ export const diDocType = {
1915
1945
  dtInterimInstructionalPermit: 236,
1916
1946
  dtCertificateOfCompetency: 237,
1917
1947
  dtCertificateOfProficiency: 238,
1948
+ dtTradeLicense: 239,
1949
+ dtPassportPage: 240,
1950
+ dtInvoice: 241,
1951
+ dtPassengerLocatorForm: 242,
1918
1952
  }
1919
1953
 
1920
1954
  export const DocFormat = {
@@ -1933,7 +1967,10 @@ export const DocReaderAction = {
1933
1967
  ERROR: 3,
1934
1968
  NOTIFICATION: 5,
1935
1969
  PROCESS_WHITE_UV_IMAGES: 6,
1970
+ PROCESS_WHITE_FLASHLIGHT: 7,
1936
1971
  MORE_PAGES_AVAILABLE: 8,
1972
+ PROCESS_IR_FRAME: 9,
1973
+ TIMEOUT: 10,
1937
1974
  }
1938
1975
 
1939
1976
  export const DocReaderFrame = {
@@ -3839,7 +3876,7 @@ export const eRFID_ErrorCodes = {
3839
3876
  case -2046820094:
3840
3877
  return "LAYER6: ISO7816_B_03 \"Mutual authentication failure\""
3841
3878
  case -2046820093:
3842
- return "null"
3879
+ return "LAYER6: ISO7816_B_03 \"Mutual authentication failure data\""
3843
3880
  case -2046819840:
3844
3881
  return "LAYER6: SM failure – MAC missing"
3845
3882
  case -2046819839:
@@ -3975,13 +4012,20 @@ export const eRPRM_Lights = {
3975
4012
  NONE: 0,
3976
4013
  RPRM_LIGHT_UV: 128,
3977
4014
  RPRM_LIGHT_WHITE_FULL: 6,
4015
+ RPRM_LIGHT_IR: 16777216,
4016
+ RPRM_Light_IR_TOP: 8,
4017
+ RPRM_Light_IR_SIDE: 16,
4018
+ RPRM_Light_IR_Full: 24,
4019
+ RPRM_LIGHT_OVD: 67108864,
3978
4020
 
3979
4021
  getTranslation(value: number) {
3980
4022
  switch (value) {
3981
- case this.RPRM_LIGHT_UV:
3982
- return "UV"
3983
- case this.RPRM_LIGHT_WHITE_FULL:
4023
+ case 6:
3984
4024
  return "Visible light"
4025
+ case 24:
4026
+ return "IR"
4027
+ case 128:
4028
+ return "UV"
3985
4029
  default:
3986
4030
  return value.toString()
3987
4031
  }
@@ -4669,6 +4713,10 @@ export const eVisualFieldType = {
4669
4713
  FT_VACCINATION_CERTIFICATE_IDENTIFIER: 644,
4670
4714
  FT_FIRST_NAME: 645,
4671
4715
  FT_DATE_OF_ARRIVAL: 646,
4716
+ FT_SECOND_NAME: 647,
4717
+ FT_THIRD_NAME: 648,
4718
+ FT_FOURTH_NAME: 649,
4719
+ FT_LAST_NAME: 650,
4672
4720
 
4673
4721
  getTranslation(value: number) {
4674
4722
  switch (value) {
@@ -5863,7 +5911,15 @@ export const eVisualFieldType = {
5863
5911
  case 645:
5864
5912
  return "First name"
5865
5913
  case 646:
5866
- return "null"
5914
+ return "Date of arrival"
5915
+ case 647:
5916
+ return "Second name"
5917
+ case 648:
5918
+ return "Third name"
5919
+ case 649:
5920
+ return "Fourth name"
5921
+ case 650:
5922
+ return "Last name"
5867
5923
  default:
5868
5924
  return value.toString()
5869
5925
  }
@@ -6523,6 +6579,7 @@ export default class DocumentReader {
6523
6579
  static startNewSession(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6524
6580
  static startRFIDReader(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6525
6581
  static stopRFIDReader(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6582
+ static stopRFIDReaderWithErrorMessage(message: string, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6526
6583
  static stopScanner(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6527
6584
  static deinitializeReader(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6528
6585
  static isAuthenticatorAvailableForUse(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
@@ -6558,10 +6615,9 @@ export default class DocumentReader {
6558
6615
  static parseCoreResults(json: string, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6559
6616
  static setTCCParams(params: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6560
6617
  static initializeReaderWithDatabase(license: string, db: string, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6561
- static recognizeImageFrame(image: string, params: ImageInputParam, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6562
6618
  static recognizeImageWithOpts(image: string, options: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6563
6619
  static recognizeVideoFrame(byteString: string, params: ImageInputParam, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6564
6620
  static showScannerWithCameraIDAndOpts(cameraID: number, options: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6565
- static recognizeImageWithImageInputParams(image: string, params: ImageInputParam, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6566
6621
  static recognizeImageWithCameraMode(image: string, mode: boolean, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6622
+ static recognizeImagesWithImageInputs(images: ImageInputData[], successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
6567
6623
  }
package/index.js CHANGED
@@ -985,6 +985,26 @@ export class DocumentReaderUvFiberElement {
985
985
  }
986
986
  }
987
987
 
988
+ export class ImageInputData {
989
+ static fromJson(jsonObject) {
990
+ if (jsonObject == null) return null
991
+ const result = new ImageInputData()
992
+
993
+ result.pageIndex = jsonObject["pageIndex"]
994
+ result.light = jsonObject["light"]
995
+ result.type = jsonObject["type"]
996
+ result.width = jsonObject["width"]
997
+ result.height = jsonObject["height"]
998
+ result.bitmap = jsonObject["bitmap"]
999
+ result.imgBytes = []
1000
+ if (jsonObject["imgBytes"] != null)
1001
+ for (const i in jsonObject["imgBytes"])
1002
+ result.imgBytes.push(jsonObject["imgBytes"][i])
1003
+
1004
+ return result
1005
+ }
1006
+ }
1007
+
988
1008
  export class DocumentReaderResults {
989
1009
  getTextFieldValueByType({ fieldType, lcid = 0, source = -1, original = false }) {
990
1010
  if (this.textResult == null) return null
@@ -1221,13 +1241,13 @@ export const diDocType = {
1221
1241
  dtIdentityCard: 12,
1222
1242
  dtDiplomaticPassport: 13,
1223
1243
  dtServicePassport: 14,
1224
- dtSeamansIdentityDocument: 15,
1225
- dtIdentityCardforResidence: 16,
1226
- dtTraveldocument: 17,
1244
+ dtSeamanIdentityDocument: 15,
1245
+ dtIdentityCardForResidence: 16,
1246
+ dtTravelDocument: 17,
1227
1247
  dtOther: 99,
1228
1248
  dtVisaID2: 29,
1229
1249
  dtVisaID3: 30,
1230
- dtRegistrationCertificate: 31,
1250
+ dtRegistrationCertificate: 206,
1231
1251
  dtNationalIdentityCard: 20,
1232
1252
  dtSocialIdentityCard: 21,
1233
1253
  dtAliensIdentityCard: 22,
@@ -1244,10 +1264,10 @@ export const diDocType = {
1244
1264
  dtChauffeurLicenseUnder18: 36,
1245
1265
  dtChauffeurLicenseUnder21: 37,
1246
1266
  dtCommercialDrivingLicense: 38,
1247
- dtCommercialDrivingLicenseIndtuctionalPermit: 39,
1267
+ dtCommercialDrivingLicenseInstructionalPermit: 39,
1248
1268
  dtCommercialDrivingLicenseUnder18: 40,
1249
1269
  dtCommercialDrivingLicenseUnder21: 41,
1250
- dtCommercialIndtuctionPermit: 42,
1270
+ dtCommercialInstructionPermit: 42,
1251
1271
  dtCommercialNewPermit: 43,
1252
1272
  dtConcealedCarryLicense: 44,
1253
1273
  dtConcealedFirearmPermit: 45,
@@ -1255,9 +1275,9 @@ export const diDocType = {
1255
1275
  dtDepartmentOfVeteransAffairsIdentityCard: 47,
1256
1276
  dtDiplomaticDrivingLicense: 48,
1257
1277
  dtDrivingLicense: 49,
1258
- dtDrivingLicenseIndtuctionalPermit: 50,
1259
- dtDrivingLicenseIndtuctionalPermitUnder18: 51,
1260
- dtDrivingLicenseIndtuctionalPermitUnder21: 52,
1278
+ dtDrivingLicenseInstructionalPermit: 50,
1279
+ dtDrivingLicenseInstructionalPermitUnder18: 51,
1280
+ dtDrivingLicenseInstructionalPermitUnder21: 52,
1261
1281
  dtDrivingLicenseLearnersPermit: 53,
1262
1282
  dtDrivingLicenseLearnersPermitUnder18: 54,
1263
1283
  dtDrivingLicenseLearnersPermitUnder21: 55,
@@ -1265,8 +1285,8 @@ export const diDocType = {
1265
1285
  dtDrivingLicenseNoviceUnder18: 57,
1266
1286
  dtDrivingLicenseNoviceUnder21: 58,
1267
1287
  dtDrivingLicenseRegisteredOffender: 59,
1268
- dtDrivingLicenseRedtictedUnder18: 60,
1269
- dtDrivingLicenseRedtictedUnder21: 61,
1288
+ dtDrivingLicenseRestrictedUnder18: 60,
1289
+ dtDrivingLicenseRestrictedUnder21: 61,
1270
1290
  dtDrivingLicenseTemporaryVisitor: 62,
1271
1291
  dtDrivingLicenseTemporaryVisitorUnder18: 63,
1272
1292
  dtDrivingLicenseTemporaryVisitorUnder21: 64,
@@ -1291,8 +1311,8 @@ export const diDocType = {
1291
1311
  dtGenevaConventionsIdentityCard: 83,
1292
1312
  dtGraduatedDrivingLicenseUnder18: 84,
1293
1313
  dtGraduatedDrivingLicenseUnder21: 85,
1294
- dtGraduatedIndtuctionPermitUnder18: 86,
1295
- dtGraduatedIndtuctionPermitUnder21: 87,
1314
+ dtGraduatedInstructionPermitUnder18: 86,
1315
+ dtGraduatedInstructionPermitUnder21: 87,
1296
1316
  dtGraduatedLicenseUnder18: 88,
1297
1317
  dtGraduatedLicenseUnder21: 89,
1298
1318
  dtHandgunCarryPermit: 90,
@@ -1306,16 +1326,16 @@ export const diDocType = {
1306
1326
  dtIdentityCardUnder21: 98,
1307
1327
  dtIgnitionInterlockPermit: 100,
1308
1328
  dtImmigrantVisa: 101,
1309
- dtIndtuctionPermit: 102,
1310
- dtIndtuctionPermitUnder18: 103,
1311
- dtIndtuctionPermitUnder21: 104,
1329
+ dtInstructionPermit: 102,
1330
+ dtInstructionPermitUnder18: 103,
1331
+ dtInstructionPermitUnder21: 104,
1312
1332
  dtInterimDrivingLicense: 105,
1313
1333
  dtInterimIdentityCard: 106,
1314
1334
  dtIntermediateDrivingLicense: 107,
1315
1335
  dtIntermediateDrivingLicenseUnder18: 108,
1316
1336
  dtIntermediateDrivingLicenseUnder21: 109,
1317
1337
  dtJuniorDrivingLicense: 110,
1318
- dtLearnerIndtuctionalPermit: 111,
1338
+ dtLearnerInstructionalPermit: 111,
1319
1339
  dtLearnerLicense: 112,
1320
1340
  dtLearnerLicenseUnder18: 113,
1321
1341
  dtLearnerLicenseUnder21: 114,
@@ -1352,9 +1372,9 @@ export const diDocType = {
1352
1372
  dtRacingAndGamingComissionCard: 145,
1353
1373
  dtRefugeeTravelDocument: 146,
1354
1374
  dtRenewalPermit: 147,
1355
- dtRedtictedCommercialDrivingLicense: 148,
1356
- dtRedtictedDrivingLicense: 149,
1357
- dtRedtictedPermit: 150,
1375
+ dtRestrictedCommercialDrivingLicense: 148,
1376
+ dtRestrictedDrivingLicense: 149,
1377
+ dtRestrictedPermit: 150,
1358
1378
  dtSeasonalPermit: 151,
1359
1379
  dtSeasonalResidentIdentityCard: 152,
1360
1380
  dtSeniorCitizenIdentityCard: 153,
@@ -1364,9 +1384,9 @@ export const diDocType = {
1364
1384
  dtTemporaryDrivingLicenseUnder18: 157,
1365
1385
  dtTemporaryDrivingLicenseUnder21: 158,
1366
1386
  dtTemporaryIdentityCard: 159,
1367
- dtTemporaryIndtuctionPermitIdentityCard: 160,
1368
- dtTemporaryIndtuctionPermitIdentityCardUnder18: 161,
1369
- dtTemporaryIndtuctionPermitIdentityCardUnder21: 162,
1387
+ dtTemporaryInstructionPermitIdentityCard: 160,
1388
+ dtTemporaryInstructionPermitIdentityCardUnder18: 161,
1389
+ dtTemporaryInstructionPermitIdentityCardUnder21: 162,
1370
1390
  dtTemporaryVisitorDrivingLicense: 163,
1371
1391
  dtTemporaryVisitorDrivingLicenseUnder18: 164,
1372
1392
  dtTemporaryVisitorDrivingLicenseUnder21: 165,
@@ -1389,15 +1409,15 @@ export const diDocType = {
1389
1409
  dtCertificateOfCitizenship: 182,
1390
1410
  dtAddressCard: 183,
1391
1411
  dtAirportImmigrationCard: 184,
1392
- dtAlienRegidtationCard: 185,
1412
+ dtAlienRegistrationCard: 185,
1393
1413
  dtAPEHCard: 186,
1394
- dtCoupontoDrivingLicense: 187,
1414
+ dtCouponToDrivingLicense: 187,
1395
1415
  dtCrewMemberCertificate: 188,
1396
1416
  dtDocumentForReturn: 189,
1397
1417
  dtECard: 190,
1398
1418
  dtEmploymentCard: 191,
1399
1419
  dtHKSARImmigrationForm: 192,
1400
- dtImmigrantcard: 193,
1420
+ dtImmigrantCard: 193,
1401
1421
  dtLabourCard: 194,
1402
1422
  dtLaissezPasser: 195,
1403
1423
  dtLawyerIdentityCertificate: 196,
@@ -1409,7 +1429,7 @@ export const diDocType = {
1409
1429
  dtPassportOfficial: 202,
1410
1430
  dtPassportProvisional: 203,
1411
1431
  dtPassportSpecial: 204,
1412
- dtPermissiontotheLocalBorderTraffic: 205,
1432
+ dtPermissionToTheLocalBorderTraffic: 205,
1413
1433
  dtSEDESOLCard: 207,
1414
1434
  dtSocialCard: 208,
1415
1435
  dtTBCard: 209,
@@ -1442,6 +1462,10 @@ export const diDocType = {
1442
1462
  dtInterimInstructionalPermit: 236,
1443
1463
  dtCertificateOfCompetency: 237,
1444
1464
  dtCertificateOfProficiency: 238,
1465
+ dtTradeLicense: 239,
1466
+ dtPassportPage: 240,
1467
+ dtInvoice: 241,
1468
+ dtPassengerLocatorForm: 242,
1445
1469
  }
1446
1470
 
1447
1471
  export const DocFormat = {
@@ -1460,7 +1484,10 @@ export const DocReaderAction = {
1460
1484
  ERROR: 3,
1461
1485
  NOTIFICATION: 5,
1462
1486
  PROCESS_WHITE_UV_IMAGES: 6,
1487
+ PROCESS_WHITE_FLASHLIGHT: 7,
1463
1488
  MORE_PAGES_AVAILABLE: 8,
1489
+ PROCESS_IR_FRAME: 9,
1490
+ TIMEOUT: 10,
1464
1491
  }
1465
1492
 
1466
1493
  export const DocReaderFrame = {
@@ -3366,7 +3393,7 @@ export const eRFID_ErrorCodes = {
3366
3393
  case -2046820094:
3367
3394
  return "LAYER6: ISO7816_B_03 \"Mutual authentication failure\""
3368
3395
  case -2046820093:
3369
- return "null"
3396
+ return "LAYER6: ISO7816_B_03 \"Mutual authentication failure data\""
3370
3397
  case -2046819840:
3371
3398
  return "LAYER6: SM failure – MAC missing"
3372
3399
  case -2046819839:
@@ -3502,13 +3529,20 @@ export const eRPRM_Lights = {
3502
3529
  NONE: 0,
3503
3530
  RPRM_LIGHT_UV: 128,
3504
3531
  RPRM_LIGHT_WHITE_FULL: 6,
3532
+ RPRM_LIGHT_IR: 16777216,
3533
+ RPRM_Light_IR_TOP: 8,
3534
+ RPRM_Light_IR_SIDE: 16,
3535
+ RPRM_Light_IR_Full: 24,
3536
+ RPRM_LIGHT_OVD: 67108864,
3505
3537
 
3506
3538
  getTranslation: function (value) {
3507
3539
  switch (value) {
3508
- case this.RPRM_LIGHT_UV:
3509
- return "UV"
3510
- case this.RPRM_LIGHT_WHITE_FULL:
3540
+ case 6:
3511
3541
  return "Visible light"
3542
+ case 24:
3543
+ return "IR"
3544
+ case 128:
3545
+ return "UV"
3512
3546
  default:
3513
3547
  return value
3514
3548
  }
@@ -4196,6 +4230,10 @@ export const eVisualFieldType = {
4196
4230
  FT_VACCINATION_CERTIFICATE_IDENTIFIER: 644,
4197
4231
  FT_FIRST_NAME: 645,
4198
4232
  FT_DATE_OF_ARRIVAL: 646,
4233
+ FT_SECOND_NAME: 647,
4234
+ FT_THIRD_NAME: 648,
4235
+ FT_FOURTH_NAME: 649,
4236
+ FT_LAST_NAME: 650,
4199
4237
 
4200
4238
  getTranslation: function (value) {
4201
4239
  switch (value) {
@@ -5390,7 +5428,15 @@ export const eVisualFieldType = {
5390
5428
  case 645:
5391
5429
  return "First name"
5392
5430
  case 646:
5393
- return "null"
5431
+ return "Date of arrival"
5432
+ case 647:
5433
+ return "Second name"
5434
+ case 648:
5435
+ return "Third name"
5436
+ case 649:
5437
+ return "Fourth name"
5438
+ case 650:
5439
+ return "Last name"
5394
5440
  default:
5395
5441
  return value
5396
5442
  }
@@ -6051,6 +6097,7 @@ DocumentReader.startNewPage = (successCallback, errorCallback) => RNRegulaDocume
6051
6097
  DocumentReader.startNewSession = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "startNewSession", [], successCallback, errorCallback)
6052
6098
  DocumentReader.startRFIDReader = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "startRFIDReader", [], successCallback, errorCallback)
6053
6099
  DocumentReader.stopRFIDReader = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "stopRFIDReader", [], successCallback, errorCallback)
6100
+ DocumentReader.stopRFIDReaderWithErrorMessage = (message, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "stopRFIDReaderWithErrorMessage", [message], successCallback, errorCallback)
6054
6101
  DocumentReader.stopScanner = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "stopScanner", [], successCallback, errorCallback)
6055
6102
  DocumentReader.deinitializeReader = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "deinitializeReader", [], successCallback, errorCallback)
6056
6103
  DocumentReader.isAuthenticatorAvailableForUse = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "isAuthenticatorAvailableForUse", [], successCallback, errorCallback)
@@ -6086,11 +6133,10 @@ DocumentReader.provideTASignature = (certificates, successCallback, errorCallbac
6086
6133
  DocumentReader.parseCoreResults = (json, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "parseCoreResults", [json], successCallback, errorCallback)
6087
6134
  DocumentReader.setTCCParams = (params, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "setTCCParams", [params], successCallback, errorCallback)
6088
6135
  DocumentReader.initializeReaderWithDatabase = (license, db, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "initializeReaderWithDatabase", [license, db], successCallback, errorCallback)
6089
- DocumentReader.recognizeImageFrame = (image, params, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeImageFrame", [image, params], successCallback, errorCallback)
6090
6136
  DocumentReader.recognizeImageWithOpts = (image, options, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeImageWithOpts", [image, options], successCallback, errorCallback)
6091
6137
  DocumentReader.recognizeVideoFrame = (byteString, params, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeVideoFrame", [byteString, params], successCallback, errorCallback)
6092
6138
  DocumentReader.showScannerWithCameraIDAndOpts = (cameraID, options, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "showScannerWithCameraIDAndOpts", [cameraID, options], successCallback, errorCallback)
6093
- DocumentReader.recognizeImageWithImageInputParams = (image, params, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeImageWithImageInputParams", [image, params], successCallback, errorCallback)
6094
6139
  DocumentReader.recognizeImageWithCameraMode = (image, mode, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeImageWithCameraMode", [image, mode], successCallback, errorCallback)
6140
+ DocumentReader.recognizeImagesWithImageInputs = (images, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeImagesWithImageInputs", [images], successCallback, errorCallback)
6095
6141
 
6096
6142
  export default DocumentReader
@@ -12,6 +12,7 @@
12
12
  +(NSMutableDictionary* _Nonnull)generateNSDictionary:(NSDictionary<NSNumber*, NSNumber*>* _Nullable)input;
13
13
  +(RGLPKDCertificate* _Nullable)RGLPKDCertificateFromJson:(NSDictionary* _Nullable) dict;
14
14
  +(RGLTCCParams* _Nonnull)RGLTCCParamsFromJson:(NSDictionary* _Nonnull)input;
15
+ +(RGLImageInput* _Nonnull)RGLImageInputFromJson:(NSDictionary* _Nonnull)input;
15
16
  +(NSInteger)generateDocReaderAction:(RGLDocReaderAction)action;
16
17
  +(NSInteger)generateRFIDCompleteAction:(RGLRFIDCompleteAction)action;
17
18
  +(NSInteger)generateRFIDNotificationAction:(RGLRFIDNotificationAction)action;
@@ -35,6 +35,20 @@
35
35
  return [[RGLTCCParams alloc] initWithServiceTAURLString:serviceTAURLString servicePAURLString:servicePAURLString pfxCertURLString:pfxCertURLString pfxCertData: pfxCertData pfxPassPhrase:pfxPassPhrase];
36
36
  }
37
37
 
38
+ +(RGLImageInput*)RGLImageInputFromJson:(NSDictionary*)input {
39
+ NSInteger pageIndex = 0;
40
+ if([input valueForKey:@"pageIndex"] != nil)
41
+ pageIndex = [[input valueForKey:@"pageIndex"] integerValue];
42
+ NSInteger light = 6;
43
+ if([input valueForKey:@"light"] != nil)
44
+ pageIndex = [[input valueForKey:@"light"] integerValue];
45
+ if([input valueForKey:@"bitmap"] != nil){
46
+ UIImage* image = [UIImage imageWithData:[[NSData alloc]initWithBase64EncodedString:[input valueForKey:@"bitmap"] options:NSDataBase64DecodingIgnoreUnknownCharacters]];
47
+ return [[RGLImageInput alloc] initWithImage:image light:light pageIndex:pageIndex];
48
+ }
49
+ return nil;
50
+ }
51
+
38
52
  +(NSMutableDictionary*)generateCGPoint:(CGPoint)input {
39
53
  NSMutableDictionary *result = [NSMutableDictionary new];
40
54
 
@@ -107,6 +121,9 @@
107
121
  case RGLDocReaderActionError:
108
122
  result = 3;
109
123
  break;
124
+ case RGLDocReaderActionProcessTimeout:
125
+ result = 10;
126
+ break;
110
127
  default:
111
128
  break;
112
129
  }
@@ -118,7 +135,7 @@
118
135
  NSInteger result = 0;
119
136
  switch (input) {
120
137
  case RGLRFIDCompleteActionComplete:
121
- result = 10;
138
+ result = 999;
122
139
  break;
123
140
  case RGLRFIDCompleteActionError:
124
141
  result = 3;
@@ -136,6 +153,29 @@
136
153
  return result;
137
154
  }
138
155
 
156
+ +(NSNumber*)generateRGLImageQualityCheckType:(RGLImageQualityCheckType)value {
157
+ if(value == RGLImageQualityCheckTypeImageGlares)
158
+ return @0;
159
+ else if(value == RGLImageQualityCheckTypeImageFocus)
160
+ return @1;
161
+ else if(value == RGLImageQualityCheckTypeImageResolution)
162
+ return @2;
163
+ else if(value == RGLImageQualityCheckTypeImageColorness)
164
+ return @3;
165
+ else if(value == RGLImageQualityCheckTypeImagePerspective)
166
+ return @4;
167
+ else if(value == RGLImageQualityCheckTypeImageBounds)
168
+ return @5;
169
+ else if(value == RGLImageQualityCheckTypeScreenCapture)
170
+ return @6;
171
+ else if(value == RGLImageQualityCheckTypePortrait)
172
+ return @7;
173
+ else if(value == RGLImageQualityCheckTypeHandwritten)
174
+ return @8;
175
+ else
176
+ return @0;
177
+ }
178
+
139
179
  +(NSInteger)generateRFIDNotificationAction:(RGLRFIDNotificationAction)input {
140
180
  return 5;
141
181
  }
@@ -155,6 +195,9 @@
155
195
  case 3:
156
196
  result[@"results"] = [self generateRGLDocumentReaderResults:results];
157
197
  break;
198
+ case 10:
199
+ result[@"results"] = [self generateRGLDocumentReaderResults:results];
200
+ break;
158
201
  case 5:
159
202
  result[@"results"] = [self generateResultsWithNotification:[self generateRGLRFIDNotify:notify]];
160
203
  break;
@@ -164,7 +207,7 @@
164
207
  case 8:
165
208
  result[@"results"] = [self generateRGLDocumentReaderResults:results];
166
209
  break;
167
- case 10:
210
+ case 999:
168
211
  result[@"results"] = [self generateResultsWithRFID :results :1];
169
212
  action = 1;
170
213
  break;
@@ -400,7 +443,7 @@
400
443
  NSMutableDictionary *result = [NSMutableDictionary new];
401
444
  if(input == nil) return result;
402
445
 
403
- result[@"type"] = input.type;
446
+ result[@"type"] = [self generateRGLImageQualityCheckType:input.type];
404
447
  result[@"result"] = @(input.result);
405
448
  result[@"featureType"] = @(input.featureType);
406
449
  result[@"boundRects"] = [self generateNSArrayCGRect:input.boundRects];
@@ -170,6 +170,8 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
170
170
  [self startRFIDReader :successCallback :errorCallback];
171
171
  else if([action isEqualToString:@"stopRFIDReader"])
172
172
  [self stopRFIDReader :successCallback :errorCallback];
173
+ else if([action isEqualToString:@"stopRFIDReaderWithErrorMessage"])
174
+ [self stopRFIDReaderWithErrorMessage :[args objectAtIndex:0] :successCallback :errorCallback];
173
175
  else if([action isEqualToString:@"stopScanner"])
174
176
  [self stopScanner :successCallback :errorCallback];
175
177
  else if([action isEqualToString:@"deinitializeReader"])
@@ -240,18 +242,16 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
240
242
  [self setTCCParams :[args objectAtIndex:0] :successCallback :errorCallback];
241
243
  else if([action isEqualToString:@"initializeReaderWithDatabase"])
242
244
  [self initializeReaderWithDatabase :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
243
- else if([action isEqualToString:@"recognizeImageFrame"])
244
- [self recognizeImageFrame :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
245
245
  else if([action isEqualToString:@"recognizeImageWithOpts"])
246
246
  [self recognizeImageWithOpts :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
247
247
  else if([action isEqualToString:@"recognizeVideoFrame"])
248
248
  [self recognizeVideoFrame :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
249
249
  else if([action isEqualToString:@"showScannerWithCameraIDAndOpts"])
250
250
  [self showScannerWithCameraIDAndOpts :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
251
- else if([action isEqualToString:@"recognizeImageWithImageInputParams"])
252
- [self recognizeImageWithImageInputParams :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
253
251
  else if([action isEqualToString:@"recognizeImageWithCameraMode"])
254
252
  [self recognizeImageWithCameraMode :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
253
+ else if([action isEqualToString:@"recognizeImagesWithImageInputs"])
254
+ [self recognizeImagesWithImageInputs :[args objectAtIndex:0] :successCallback :errorCallback];
255
255
  else
256
256
  [self result:[NSString stringWithFormat:@"%@/%@", @"method not implemented: ", action] :errorCallback];
257
257
  }
@@ -274,8 +274,10 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
274
274
  [self result:@"showScannerWithCameraID() is an android-only method" :errorCallback];
275
275
  }
276
276
 
277
- - (void) recognizeImageFrame:(NSString*)base64 :(NSDictionary*)opts :(Callback)successCallback :(Callback)errorCallback{
278
- [self result:@"recognizeImageFrame() is an android-only method" :errorCallback];
277
+ - (void) stopRFIDReaderWithErrorMessage:(NSMutableString*)message :(Callback)successCallback :(Callback)errorCallback{
278
+ [RGLDocReader.shared stopRFIDReaderWithErrorMessage:message completion:^() {
279
+ [self result:@"" :successCallback];
280
+ }];
279
281
  }
280
282
 
281
283
  - (void) recognizeImageWithOpts:(NSString*)base64 :(NSDictionary*)opts :(Callback)successCallback :(Callback)errorCallback{
@@ -290,10 +292,6 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
290
292
  [self result:@"showScannerWithCameraIDAndOpts() is an android-only method" :errorCallback];
291
293
  }
292
294
 
293
- - (void) recognizeImageWithImageInputParams:(NSString*)base64 :(NSDictionary*)params :(Callback)successCallback :(Callback)errorCallback{
294
- [self result:@"recognizeImageWithImageInputParams() is an android-only method" :errorCallback];
295
- }
296
-
297
295
  - (void) getLicenseMessage:(Callback)successCallback :(Callback)errorCallback{
298
296
  [self result:@"getLicenseMessage() is an android-only method" :successCallback];
299
297
  }
@@ -359,6 +357,15 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
359
357
  });
360
358
  }
361
359
 
360
+ - (void) recognizeImagesWithImageInputs:(NSArray*)input :(Callback)successCallback :(Callback)errorCallback{
361
+ NSMutableArray<RGLImageInput*>* images = [[NSMutableArray alloc] init];
362
+ for(__strong NSDictionary* image in input)
363
+ [images addObject:[RGLWJSONConstructor RGLImageInputFromJson: image]];
364
+ dispatch_async(dispatch_get_main_queue(), ^{
365
+ [RGLDocReader.shared recognizeImagesWithImageInputs:images completion:[self getCompletion]];
366
+ });
367
+ }
368
+
362
369
  - (void) recognizeImageWithCameraMode:(NSMutableString*)base64 :(BOOL)cameraMode :(Callback)successCallback :(Callback)errorCallback{
363
370
  [self recognizeImageWith :base64 :cameraMode :successCallback :errorCallback];
364
371
  }
@@ -550,6 +550,8 @@
550
550
  customization.hologramAnimationPositionMultiplier = [[options valueForKey:@"hologramAnimationPositionMultiplier"] floatValue];
551
551
  if([options valueForKey:@"hologramAnimationImage"] != nil)
552
552
  customization.hologramAnimationImage = [self imageFromBase64:[options valueForKey:@"hologramAnimationImage"]];
553
+ if([options valueForKey:@"uiCustomizationLayer"] != nil)
554
+ customization.customUILayerJSON = [options valueForKey:@"uiCustomizationLayer"];
553
555
  }
554
556
 
555
557
  +(void)setFunctionality:(NSDictionary*)options :(RGLFunctionality*)functionality {
@@ -755,6 +757,7 @@
755
757
  result[@"toolbarSize"] = [NSNumber numberWithFloat:customization.toolbarSize];
756
758
  result[@"hologramAnimationImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.hologramAnimationImageContentMode]];
757
759
  result[@"hologramAnimationPositionMultiplier"] = [NSNumber numberWithFloat:customization.hologramAnimationPositionMultiplier];
760
+ result[@"uiCustomizationLayer"] = customization.customUILayerJSON;
758
761
  result[@"hologramAnimationImage"] = [UIImageJPEGRepresentation(customization.hologramAnimationImage, 1.0) base64EncodedStringWithOptions:0];
759
762
  if(customization.customLabelStatus != nil)
760
763
  result[@"customLabelStatus"] = customization.customLabelStatus.string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/react-native-document-reader-api",
3
- "version": "6.3.1",
3
+ "version": "6.4.0",
4
4
  "description": "React Native module for reading and validation of identification documents (API framework)",
5
5
  "main": "index.js",
6
6
  "scripts": {