@regulaforensics/react-native-document-reader-api 6.2.2 → 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.
- package/.github/ISSUE_TEMPLATE/bug-report.md +39 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature-request.md +20 -0
- package/README.md +1 -4
- package/RNDocumentReaderApi.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/regula/documentreader/JSONConstructor.java +74 -0
- package/android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java +35 -21
- package/android/src/main/java/com/regula/documentreader/RegulaConfig.java +18 -0
- package/example/package.json +2 -2
- package/index.d.ts +92 -35
- package/index.js +82 -35
- package/ios/RGLWJSONConstructor.h +2 -0
- package/ios/RGLWJSONConstructor.m +56 -3
- package/ios/RNRegulaDocumentReader.m +32 -16
- package/ios/RegulaConfig.m +19 -0
- package/package.json +1 -1
|
@@ -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,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.-->
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ This repository contains the source code of the Document Reader API, and the sam
|
|
|
12
12
|
* [Additional information](#additional-information)
|
|
13
13
|
|
|
14
14
|
## How to build demo application
|
|
15
|
-
1. Visit [
|
|
15
|
+
1. Visit [client.regulaforensics.com](https://client.regulaforensics.com) to get a trial license (`regula.license` file). The license creation wizard will guide you through the necessary steps.
|
|
16
16
|
2. Download or clone this repository using the command `git clone https://github.com/regulaforensics/react-native-document-reader.git`.
|
|
17
17
|
3. Run the following commands in Terminal:
|
|
18
18
|
```bash
|
|
@@ -26,20 +26,17 @@ $ pod install
|
|
|
26
26
|
|
|
27
27
|
4. Android:
|
|
28
28
|
* Copy the `regula.license` file to the `example/android/app/src/main/assets` folder.
|
|
29
|
-
* Change the application ID to the one you have specified during the registration at [licensing.regulaforensics.com](https://licensing.regulaforensics.com).
|
|
30
29
|
* Run `npx react-native run-android` inside `example` folder - this is just one way to run the app. You can also run it directly from within Android Studio. **Note**: `npx react-native log-android` is used to view logs.
|
|
31
30
|
|
|
32
31
|
**Note**: if the running failed with the following error `Error: spawn ./gradlew EACCES`, try to run the following command `chmod +x gradlew` within the `example/android` directory.
|
|
33
32
|
|
|
34
33
|
5. iOS:
|
|
35
34
|
* Copy the `regula.license` file to the `example/ios/DocumentReader` folder.
|
|
36
|
-
* Change the Bundle Identifier to the one you have specified during the registration at [licensing.regulaforensics.com](https://licensing.regulaforensics.com).
|
|
37
35
|
* Run `npx react-native run-ios` inside `example` folder - this is just one way to run the app. You can also run it directly from within Xcode.
|
|
38
36
|
|
|
39
37
|
### Troubleshooting license issues
|
|
40
38
|
If you have issues with license verification when running the application, please verify that next is true:
|
|
41
39
|
1. The OS, which you use, is specified in the license (e.g., Android and/or iOS).
|
|
42
|
-
2. The application (Bundle) ID, which you use, is specified in the license.
|
|
43
40
|
3. The license is valid (not expired).
|
|
44
41
|
4. The date and time on the device, where you run the application, are valid.
|
|
45
42
|
5. You use the latest release version of the Document Reader SDK.
|
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
52
|
+
implementation('com.regula.documentreader:api:6.4.7224') {
|
|
53
53
|
transitive = true
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -16,6 +16,8 @@ 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;
|
|
20
|
+
import com.regula.documentreader.api.params.rfid.TccParams;
|
|
19
21
|
import com.regula.documentreader.api.params.rfid.authorization.PAAttribute;
|
|
20
22
|
import com.regula.documentreader.api.params.rfid.authorization.PAResourcesIssuer;
|
|
21
23
|
import com.regula.documentreader.api.params.rfid.authorization.TAChallenge;
|
|
@@ -340,6 +342,61 @@ class JSONConstructor {
|
|
|
340
342
|
return result;
|
|
341
343
|
}
|
|
342
344
|
|
|
345
|
+
static TccParams TCCParamsFromJSON(JSONObject input) {
|
|
346
|
+
TccParams result = new TccParams();
|
|
347
|
+
try {
|
|
348
|
+
if (input.has("serviceUrlTA"))
|
|
349
|
+
result.setServiceUrlTA(input.getString("serviceUrlTA"));
|
|
350
|
+
if (input.has("serviceUrlPA"))
|
|
351
|
+
result.setServiceUrlPA(input.getString("serviceUrlPA"));
|
|
352
|
+
if (input.has("pfxCertUrl"))
|
|
353
|
+
result.setPfxCertUrl(input.getString("pfxCertUrl"));
|
|
354
|
+
if (input.has("pfxPassPhrase"))
|
|
355
|
+
result.setPfxPassPhrase(input.getString("pfxPassPhrase"));
|
|
356
|
+
if (input.has("pfxCert"))
|
|
357
|
+
result.setPfxCert(Base64.decode(input.getString("pfxCert"), Base64.DEFAULT));
|
|
358
|
+
} catch (JSONException e) {
|
|
359
|
+
e.printStackTrace();
|
|
360
|
+
}
|
|
361
|
+
return result;
|
|
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
|
+
|
|
343
400
|
static Throwable ThrowableFromJSON(JSONObject jsonObject) {
|
|
344
401
|
return new Throwable();
|
|
345
402
|
}
|
|
@@ -1164,6 +1221,23 @@ class JSONConstructor {
|
|
|
1164
1221
|
return result;
|
|
1165
1222
|
}
|
|
1166
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
|
+
|
|
1167
1241
|
static JSONObject generateDocumentReaderResults(DocumentReaderResults input, Context context) {
|
|
1168
1242
|
JSONObject result = new JSONObject();
|
|
1169
1243
|
if (input == null) return result;
|
|
@@ -28,10 +28,12 @@ import com.regula.documentreader.api.completions.IDocumentReaderPrepareCompletio
|
|
|
28
28
|
import com.regula.documentreader.api.completions.IRfidPKDCertificateCompletion;
|
|
29
29
|
import com.regula.documentreader.api.completions.IRfidReaderRequest;
|
|
30
30
|
import com.regula.documentreader.api.completions.IRfidTASignatureCompletion;
|
|
31
|
+
import com.regula.documentreader.api.completions.ITccParamsCompletion;
|
|
31
32
|
import com.regula.documentreader.api.enums.DocReaderAction;
|
|
32
33
|
import com.regula.documentreader.api.errors.DocumentReaderException;
|
|
33
34
|
import com.regula.documentreader.api.internal.core.CoreScenarioUtil;
|
|
34
35
|
import com.regula.documentreader.api.params.DocReaderConfig;
|
|
36
|
+
import com.regula.documentreader.api.params.ImageInputData;
|
|
35
37
|
import com.regula.documentreader.api.params.ImageInputParam;
|
|
36
38
|
import com.regula.documentreader.api.params.rfid.PKDCertificate;
|
|
37
39
|
import com.regula.documentreader.api.params.rfid.authorization.PAResourcesIssuer;
|
|
@@ -252,6 +254,9 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
252
254
|
case "stopRFIDReader":
|
|
253
255
|
stopRFIDReader(callback);
|
|
254
256
|
break;
|
|
257
|
+
case "stopRFIDReaderWithErrorMessage":
|
|
258
|
+
stopRFIDReaderWithErrorMessage(callback, args(0));
|
|
259
|
+
break;
|
|
255
260
|
case "stopScanner":
|
|
256
261
|
stopScanner(callback);
|
|
257
262
|
break;
|
|
@@ -351,15 +356,12 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
351
356
|
case "parseCoreResults":
|
|
352
357
|
parseCoreResults(callback, args(0));
|
|
353
358
|
break;
|
|
354
|
-
case "
|
|
355
|
-
|
|
359
|
+
case "setTCCParams":
|
|
360
|
+
setTCCParams(callback, args(0));
|
|
356
361
|
break;
|
|
357
362
|
case "initializeReaderWithDatabase":
|
|
358
363
|
initializeReaderWithDatabase(callback, args(0), args(1));
|
|
359
364
|
break;
|
|
360
|
-
case "recognizeImageFrame":
|
|
361
|
-
recognizeImageFrame(callback, args(0), args(1));
|
|
362
|
-
break;
|
|
363
365
|
case "recognizeImageWithOpts":
|
|
364
366
|
recognizeImageWithOpts(callback, args(0), args(1));
|
|
365
367
|
break;
|
|
@@ -369,12 +371,12 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
369
371
|
case "showScannerWithCameraIDAndOpts":
|
|
370
372
|
showScannerWithCameraIDAndOpts(callback, args(0), args(1));
|
|
371
373
|
break;
|
|
372
|
-
case "recognizeImageWithImageInputParams":
|
|
373
|
-
recognizeImageWithImageInputParams(callback, args(0), args(1));
|
|
374
|
-
break;
|
|
375
374
|
case "recognizeImageWithCameraMode":
|
|
376
375
|
recognizeImageWithCameraMode(callback, args(0), args(1));
|
|
377
376
|
break;
|
|
377
|
+
case "recognizeImagesWithImageInputs":
|
|
378
|
+
recognizeImagesWithImageInputs(callback, args(0));
|
|
379
|
+
break;
|
|
378
380
|
}
|
|
379
381
|
} catch (Exception ignored) {
|
|
380
382
|
}
|
|
@@ -464,6 +466,10 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
464
466
|
callback.success(Instance().version.database.documentsNumber);
|
|
465
467
|
}
|
|
466
468
|
|
|
469
|
+
private void setTCCParams(Callback callback, final JSONObject params) {
|
|
470
|
+
Instance().setTccParams(JSONConstructor.TCCParamsFromJSON(params), getTCCParamsCompletion(callback));
|
|
471
|
+
}
|
|
472
|
+
|
|
467
473
|
private void deinitializeReader(Callback callback) {
|
|
468
474
|
Instance().deinitializeReader();
|
|
469
475
|
callback.success();
|
|
@@ -543,10 +549,6 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
543
549
|
callback.success();
|
|
544
550
|
}
|
|
545
551
|
|
|
546
|
-
private void recognizeImageWithImageInputParams(@SuppressWarnings("unused") Callback callback, String base64Image, final JSONObject params) throws JSONException {
|
|
547
|
-
Instance().recognizeImage(Helpers.bitmapFromBase64(base64Image), new ImageInputParam(params.getInt("width"), params.getInt("height"), params.getInt("type")), getCompletion());
|
|
548
|
-
}
|
|
549
|
-
|
|
550
552
|
private void recognizeImageWithOpts(Callback callback, String base64Image, final JSONObject opts) throws JSONException {
|
|
551
553
|
RegulaConfig.setConfig(Instance(), opts, getContext());
|
|
552
554
|
recognizeImage(callback, base64Image);
|
|
@@ -565,6 +567,14 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
565
567
|
Instance().recognizeImages(images, getCompletion());
|
|
566
568
|
}
|
|
567
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
|
+
|
|
568
578
|
private void removeDatabase(Callback callback) {
|
|
569
579
|
callback.success(Instance().removeDatabase(getContext()));
|
|
570
580
|
}
|
|
@@ -598,10 +608,6 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
598
608
|
callback.success();
|
|
599
609
|
}
|
|
600
610
|
|
|
601
|
-
private void recognizeImageFrame(@SuppressWarnings("unused") Callback callback, String base64Image, final JSONObject opts) throws JSONException {
|
|
602
|
-
Instance().recognizeImageFrame(Helpers.bitmapFromBase64(base64Image), new ImageInputParam(opts.getInt("width"), opts.getInt("height"), opts.getInt("type")), getCompletion());
|
|
603
|
-
}
|
|
604
|
-
|
|
605
611
|
private void recognizeVideoFrame(@SuppressWarnings("unused") Callback callback, String byteString, final JSONObject opts) throws JSONException {
|
|
606
612
|
stopBackgroundRFID();
|
|
607
613
|
Instance().recognizeVideoFrame(byteString.getBytes(), new ImageInputParam(opts.getInt("width"), opts.getInt("height"), opts.getInt("type")), getCompletion());
|
|
@@ -720,14 +726,13 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
720
726
|
callback.error("getCameraSessionIsPaused() is an ios-only method");
|
|
721
727
|
}
|
|
722
728
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
callback.error("recognizeImageWithCameraMode() is an ios-only method");
|
|
729
|
+
private void stopRFIDReaderWithErrorMessage(Callback callback, String message) {
|
|
730
|
+
callback.error("stopRFIDReaderWithErrorMessage() is an ios-only method");
|
|
726
731
|
}
|
|
727
732
|
|
|
728
733
|
@SuppressWarnings("unused")
|
|
729
|
-
private void
|
|
730
|
-
callback.error("
|
|
734
|
+
private void recognizeImageWithCameraMode(Callback callback, String base64, boolean mode) {
|
|
735
|
+
callback.error("recognizeImageWithCameraMode() is an ios-only method");
|
|
731
736
|
}
|
|
732
737
|
|
|
733
738
|
@SuppressWarnings("unused")
|
|
@@ -777,6 +782,15 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
777
782
|
};
|
|
778
783
|
}
|
|
779
784
|
|
|
785
|
+
private ITccParamsCompletion getTCCParamsCompletion(Callback callback) {
|
|
786
|
+
return (success, error) -> {
|
|
787
|
+
if (success)
|
|
788
|
+
callback.success("success");
|
|
789
|
+
else
|
|
790
|
+
callback.error("failed: " + error.getMessage());
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
|
|
780
794
|
private IRfidReaderRequest getIRfidReaderRequest() {
|
|
781
795
|
return new IRfidReaderRequest() {
|
|
782
796
|
@Override
|
|
@@ -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
|
}
|
|
@@ -323,6 +325,16 @@ class RegulaConfig {
|
|
|
323
325
|
editor.setToolbarSize(BigDecimal.valueOf(opts.getDouble("toolbarSize")).floatValue());
|
|
324
326
|
if (opts.has("statusBackgroundColor"))
|
|
325
327
|
editor.setStatusBackgroundColor(opts.getString("statusBackgroundColor"));
|
|
328
|
+
if (opts.has("hologramAnimationImage"))
|
|
329
|
+
editor.setHologramAnimationImage(drawableFromBase64(opts.getString("hologramAnimationImage"), context));
|
|
330
|
+
if (opts.has("hologramAnimationPositionMultiplier"))
|
|
331
|
+
editor.setHologramAnimationPositionMultiplier((float) opts.getDouble("hologramAnimationPositionMultiplier"));
|
|
332
|
+
if (opts.has("hologramAnimationImageMatrix"))
|
|
333
|
+
editor.setHologramAnimationImageMatrix(matrixFromFloatArray(floatArrayFromJson(opts.getJSONArray("hologramAnimationImageMatrix"))));
|
|
334
|
+
if (opts.has("hologramAnimationImageScaleType"))
|
|
335
|
+
editor.setHologramAnimationImageScaleType(ScaleType.valueOf(opts.getString("hologramAnimationImageScaleType")));
|
|
336
|
+
if (opts.has("uiCustomizationLayer"))
|
|
337
|
+
editor.setUiCustomizationLayer(opts.getJSONObject("uiCustomizationLayer"));
|
|
326
338
|
|
|
327
339
|
editor.applyImmediately(context);
|
|
328
340
|
}
|
|
@@ -363,6 +375,7 @@ class RegulaConfig {
|
|
|
363
375
|
object.put("recordScanningProcess", functionality.doRecordProcessingVideo());
|
|
364
376
|
object.put("manualMultipageMode", functionality.isManualMultipageMode());
|
|
365
377
|
object.put("exposure", functionality.getExposure());
|
|
378
|
+
object.put("rfidTimeout", functionality.getRfidTimeout());
|
|
366
379
|
|
|
367
380
|
return object;
|
|
368
381
|
}
|
|
@@ -423,6 +436,11 @@ class RegulaConfig {
|
|
|
423
436
|
object.put("changeFrameButtonCollapseImage", bitmapToBase64String(bitmapFromDrawable(customization.getChangeFrameCollapseButtonDrawable())));
|
|
424
437
|
object.put("toolbarSize", customization.getToolbarSize());
|
|
425
438
|
object.put("statusBackgroundColor", customization.getStatusBackgroundColor());
|
|
439
|
+
object.put("hologramAnimationImage", bitmapToBase64String(bitmapFromDrawable(customization.getHologramAnimationImage())));
|
|
440
|
+
object.put("hologramAnimationPositionMultiplier", customization.getHologramAnimationPositionMultiplier());
|
|
441
|
+
object.put("hologramAnimationImageMatrix", customization.getHologramAnimationImageMatrix());
|
|
442
|
+
object.put("hologramAnimationImageScaleType", customization.getHologramAnimationImageScaleType());
|
|
443
|
+
object.put("uiCustomizationLayer", customization.getUiCustomizationLayer());
|
|
426
444
|
|
|
427
445
|
return object;
|
|
428
446
|
}
|
package/example/package.json
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"lint": "eslint ."
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@regulaforensics/react-native-document-reader-api": "^6.
|
|
14
|
-
"@regulaforensics/react-native-document-reader-core-fullrfid": "^6.
|
|
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
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1727
|
+
dtSeamanIdentityDocument: 15,
|
|
1728
|
+
dtIdentityCardForResidence: 16,
|
|
1729
|
+
dtTravelDocument: 17,
|
|
1700
1730
|
dtOther: 99,
|
|
1701
1731
|
dtVisaID2: 29,
|
|
1702
1732
|
dtVisaID3: 30,
|
|
1703
|
-
dtRegistrationCertificate:
|
|
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
|
-
|
|
1750
|
+
dtCommercialDrivingLicenseInstructionalPermit: 39,
|
|
1721
1751
|
dtCommercialDrivingLicenseUnder18: 40,
|
|
1722
1752
|
dtCommercialDrivingLicenseUnder21: 41,
|
|
1723
|
-
|
|
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
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
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
|
-
|
|
1742
|
-
|
|
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
|
-
|
|
1768
|
-
|
|
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
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
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
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
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
|
-
|
|
1895
|
+
dtAlienRegistrationCard: 185,
|
|
1866
1896
|
dtAPEHCard: 186,
|
|
1867
|
-
|
|
1897
|
+
dtCouponToDrivingLicense: 187,
|
|
1868
1898
|
dtCrewMemberCertificate: 188,
|
|
1869
1899
|
dtDocumentForReturn: 189,
|
|
1870
1900
|
dtECard: 190,
|
|
1871
1901
|
dtEmploymentCard: 191,
|
|
1872
1902
|
dtHKSARImmigrationForm: 192,
|
|
1873
|
-
|
|
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
|
-
|
|
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 = {
|
|
@@ -2157,6 +2194,7 @@ export const eImageQualityCheckType = {
|
|
|
2157
2194
|
IQC_BOUNDS: 5,
|
|
2158
2195
|
IQC_SCREEN_CAPTURE: 6,
|
|
2159
2196
|
IQC_PORTRAIT: 7,
|
|
2197
|
+
IQC_HANDWRITTEN: 8,
|
|
2160
2198
|
}
|
|
2161
2199
|
|
|
2162
2200
|
export const eLDS_ParsingErrorCodes = {
|
|
@@ -3838,7 +3876,7 @@ export const eRFID_ErrorCodes = {
|
|
|
3838
3876
|
case -2046820094:
|
|
3839
3877
|
return "LAYER6: ISO7816_B_03 \"Mutual authentication failure\""
|
|
3840
3878
|
case -2046820093:
|
|
3841
|
-
return "
|
|
3879
|
+
return "LAYER6: ISO7816_B_03 \"Mutual authentication failure data\""
|
|
3842
3880
|
case -2046819840:
|
|
3843
3881
|
return "LAYER6: SM failure – MAC missing"
|
|
3844
3882
|
case -2046819839:
|
|
@@ -3974,13 +4012,20 @@ export const eRPRM_Lights = {
|
|
|
3974
4012
|
NONE: 0,
|
|
3975
4013
|
RPRM_LIGHT_UV: 128,
|
|
3976
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,
|
|
3977
4020
|
|
|
3978
4021
|
getTranslation(value: number) {
|
|
3979
4022
|
switch (value) {
|
|
3980
|
-
case
|
|
3981
|
-
return "UV"
|
|
3982
|
-
case this.RPRM_LIGHT_WHITE_FULL:
|
|
4023
|
+
case 6:
|
|
3983
4024
|
return "Visible light"
|
|
4025
|
+
case 24:
|
|
4026
|
+
return "IR"
|
|
4027
|
+
case 128:
|
|
4028
|
+
return "UV"
|
|
3984
4029
|
default:
|
|
3985
4030
|
return value.toString()
|
|
3986
4031
|
}
|
|
@@ -4668,6 +4713,10 @@ export const eVisualFieldType = {
|
|
|
4668
4713
|
FT_VACCINATION_CERTIFICATE_IDENTIFIER: 644,
|
|
4669
4714
|
FT_FIRST_NAME: 645,
|
|
4670
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,
|
|
4671
4720
|
|
|
4672
4721
|
getTranslation(value: number) {
|
|
4673
4722
|
switch (value) {
|
|
@@ -5862,7 +5911,15 @@ export const eVisualFieldType = {
|
|
|
5862
5911
|
case 645:
|
|
5863
5912
|
return "First name"
|
|
5864
5913
|
case 646:
|
|
5865
|
-
return "
|
|
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"
|
|
5866
5923
|
default:
|
|
5867
5924
|
return value.toString()
|
|
5868
5925
|
}
|
|
@@ -6522,6 +6579,7 @@ export default class DocumentReader {
|
|
|
6522
6579
|
static startNewSession(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6523
6580
|
static startRFIDReader(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6524
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
|
|
6525
6583
|
static stopScanner(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6526
6584
|
static deinitializeReader(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6527
6585
|
static isAuthenticatorAvailableForUse(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
@@ -6555,12 +6613,11 @@ export default class DocumentReader {
|
|
|
6555
6613
|
static provideTACertificates(certificates: PKDCertificate[], successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6556
6614
|
static provideTASignature(certificates: byte[], successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6557
6615
|
static parseCoreResults(json: string, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6558
|
-
static
|
|
6616
|
+
static setTCCParams(params: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6559
6617
|
static initializeReaderWithDatabase(license: string, db: string, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6560
|
-
static recognizeImageFrame(image: string, params: ImageInputParam, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6561
6618
|
static recognizeImageWithOpts(image: string, options: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6562
6619
|
static recognizeVideoFrame(byteString: string, params: ImageInputParam, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6563
6620
|
static showScannerWithCameraIDAndOpts(cameraID: number, options: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6564
|
-
static recognizeImageWithImageInputParams(image: string, params: ImageInputParam, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
6565
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
|
|
6566
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
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1244
|
+
dtSeamanIdentityDocument: 15,
|
|
1245
|
+
dtIdentityCardForResidence: 16,
|
|
1246
|
+
dtTravelDocument: 17,
|
|
1227
1247
|
dtOther: 99,
|
|
1228
1248
|
dtVisaID2: 29,
|
|
1229
1249
|
dtVisaID3: 30,
|
|
1230
|
-
dtRegistrationCertificate:
|
|
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
|
-
|
|
1267
|
+
dtCommercialDrivingLicenseInstructionalPermit: 39,
|
|
1248
1268
|
dtCommercialDrivingLicenseUnder18: 40,
|
|
1249
1269
|
dtCommercialDrivingLicenseUnder21: 41,
|
|
1250
|
-
|
|
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
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
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
|
-
|
|
1269
|
-
|
|
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
|
-
|
|
1295
|
-
|
|
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
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
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
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
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
|
-
|
|
1412
|
+
dtAlienRegistrationCard: 185,
|
|
1393
1413
|
dtAPEHCard: 186,
|
|
1394
|
-
|
|
1414
|
+
dtCouponToDrivingLicense: 187,
|
|
1395
1415
|
dtCrewMemberCertificate: 188,
|
|
1396
1416
|
dtDocumentForReturn: 189,
|
|
1397
1417
|
dtECard: 190,
|
|
1398
1418
|
dtEmploymentCard: 191,
|
|
1399
1419
|
dtHKSARImmigrationForm: 192,
|
|
1400
|
-
|
|
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
|
-
|
|
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 = {
|
|
@@ -1684,6 +1711,7 @@ export const eImageQualityCheckType = {
|
|
|
1684
1711
|
IQC_BOUNDS: 5,
|
|
1685
1712
|
IQC_SCREEN_CAPTURE: 6,
|
|
1686
1713
|
IQC_PORTRAIT: 7,
|
|
1714
|
+
IQC_HANDWRITTEN: 8,
|
|
1687
1715
|
}
|
|
1688
1716
|
|
|
1689
1717
|
export const eLDS_ParsingErrorCodes = {
|
|
@@ -3365,7 +3393,7 @@ export const eRFID_ErrorCodes = {
|
|
|
3365
3393
|
case -2046820094:
|
|
3366
3394
|
return "LAYER6: ISO7816_B_03 \"Mutual authentication failure\""
|
|
3367
3395
|
case -2046820093:
|
|
3368
|
-
return "
|
|
3396
|
+
return "LAYER6: ISO7816_B_03 \"Mutual authentication failure data\""
|
|
3369
3397
|
case -2046819840:
|
|
3370
3398
|
return "LAYER6: SM failure – MAC missing"
|
|
3371
3399
|
case -2046819839:
|
|
@@ -3501,13 +3529,20 @@ export const eRPRM_Lights = {
|
|
|
3501
3529
|
NONE: 0,
|
|
3502
3530
|
RPRM_LIGHT_UV: 128,
|
|
3503
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,
|
|
3504
3537
|
|
|
3505
3538
|
getTranslation: function (value) {
|
|
3506
3539
|
switch (value) {
|
|
3507
|
-
case
|
|
3508
|
-
return "UV"
|
|
3509
|
-
case this.RPRM_LIGHT_WHITE_FULL:
|
|
3540
|
+
case 6:
|
|
3510
3541
|
return "Visible light"
|
|
3542
|
+
case 24:
|
|
3543
|
+
return "IR"
|
|
3544
|
+
case 128:
|
|
3545
|
+
return "UV"
|
|
3511
3546
|
default:
|
|
3512
3547
|
return value
|
|
3513
3548
|
}
|
|
@@ -4195,6 +4230,10 @@ export const eVisualFieldType = {
|
|
|
4195
4230
|
FT_VACCINATION_CERTIFICATE_IDENTIFIER: 644,
|
|
4196
4231
|
FT_FIRST_NAME: 645,
|
|
4197
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,
|
|
4198
4237
|
|
|
4199
4238
|
getTranslation: function (value) {
|
|
4200
4239
|
switch (value) {
|
|
@@ -5389,7 +5428,15 @@ export const eVisualFieldType = {
|
|
|
5389
5428
|
case 645:
|
|
5390
5429
|
return "First name"
|
|
5391
5430
|
case 646:
|
|
5392
|
-
return "
|
|
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"
|
|
5393
5440
|
default:
|
|
5394
5441
|
return value
|
|
5395
5442
|
}
|
|
@@ -6050,6 +6097,7 @@ DocumentReader.startNewPage = (successCallback, errorCallback) => RNRegulaDocume
|
|
|
6050
6097
|
DocumentReader.startNewSession = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "startNewSession", [], successCallback, errorCallback)
|
|
6051
6098
|
DocumentReader.startRFIDReader = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "startRFIDReader", [], successCallback, errorCallback)
|
|
6052
6099
|
DocumentReader.stopRFIDReader = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "stopRFIDReader", [], successCallback, errorCallback)
|
|
6100
|
+
DocumentReader.stopRFIDReaderWithErrorMessage = (message, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "stopRFIDReaderWithErrorMessage", [message], successCallback, errorCallback)
|
|
6053
6101
|
DocumentReader.stopScanner = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "stopScanner", [], successCallback, errorCallback)
|
|
6054
6102
|
DocumentReader.deinitializeReader = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "deinitializeReader", [], successCallback, errorCallback)
|
|
6055
6103
|
DocumentReader.isAuthenticatorAvailableForUse = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "isAuthenticatorAvailableForUse", [], successCallback, errorCallback)
|
|
@@ -6083,13 +6131,12 @@ DocumentReader.providePACertificates = (certificates, successCallback, errorCall
|
|
|
6083
6131
|
DocumentReader.provideTACertificates = (certificates, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "provideTACertificates", [certificates], successCallback, errorCallback)
|
|
6084
6132
|
DocumentReader.provideTASignature = (certificates, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "provideTASignature", [certificates], successCallback, errorCallback)
|
|
6085
6133
|
DocumentReader.parseCoreResults = (json, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "parseCoreResults", [json], successCallback, errorCallback)
|
|
6086
|
-
DocumentReader.
|
|
6134
|
+
DocumentReader.setTCCParams = (params, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "setTCCParams", [params], successCallback, errorCallback)
|
|
6087
6135
|
DocumentReader.initializeReaderWithDatabase = (license, db, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "initializeReaderWithDatabase", [license, db], successCallback, errorCallback)
|
|
6088
|
-
DocumentReader.recognizeImageFrame = (image, params, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeImageFrame", [image, params], successCallback, errorCallback)
|
|
6089
6136
|
DocumentReader.recognizeImageWithOpts = (image, options, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeImageWithOpts", [image, options], successCallback, errorCallback)
|
|
6090
6137
|
DocumentReader.recognizeVideoFrame = (byteString, params, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeVideoFrame", [byteString, params], successCallback, errorCallback)
|
|
6091
6138
|
DocumentReader.showScannerWithCameraIDAndOpts = (cameraID, options, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "showScannerWithCameraIDAndOpts", [cameraID, options], successCallback, errorCallback)
|
|
6092
|
-
DocumentReader.recognizeImageWithImageInputParams = (image, params, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "recognizeImageWithImageInputParams", [image, params], successCallback, errorCallback)
|
|
6093
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)
|
|
6094
6141
|
|
|
6095
6142
|
export default DocumentReader
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
+(NSMutableDictionary* _Nonnull)generateRfidNotificationCompletionWithError:(NSInteger)notification : (NSInteger)value;
|
|
12
12
|
+(NSMutableDictionary* _Nonnull)generateNSDictionary:(NSDictionary<NSNumber*, NSNumber*>* _Nullable)input;
|
|
13
13
|
+(RGLPKDCertificate* _Nullable)RGLPKDCertificateFromJson:(NSDictionary* _Nullable) dict;
|
|
14
|
+
+(RGLTCCParams* _Nonnull)RGLTCCParamsFromJson:(NSDictionary* _Nonnull)input;
|
|
15
|
+
+(RGLImageInput* _Nonnull)RGLImageInputFromJson:(NSDictionary* _Nonnull)input;
|
|
14
16
|
+(NSInteger)generateDocReaderAction:(RGLDocReaderAction)action;
|
|
15
17
|
+(NSInteger)generateRFIDCompleteAction:(RGLRFIDCompleteAction)action;
|
|
16
18
|
+(NSInteger)generateRFIDNotificationAction:(RGLRFIDNotificationAction)action;
|
|
@@ -25,6 +25,30 @@
|
|
|
25
25
|
return [[RGLPKDCertificate alloc] initWithBinaryData:binaryData resourceType:type privateKey:privateKey];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
+(RGLTCCParams*)RGLTCCParamsFromJson:(NSDictionary*)input {
|
|
29
|
+
NSString* serviceTAURLString = [input valueForKey:@"serviceUrlTA"];
|
|
30
|
+
NSString* servicePAURLString = [input valueForKey:@"serviceUrlPA"];
|
|
31
|
+
NSString* pfxCertURLString = [input valueForKey:@"pfxCertUrl"];
|
|
32
|
+
NSString* pfxPassPhrase = [input valueForKey:@"pfxPassPhrase"];
|
|
33
|
+
NSData* pfxCertData = [input objectForKey:@"pfxCert"] != nil ? [[NSData alloc] initWithBase64EncodedString:[input objectForKey:@"pfxCert"] options:0] : nil;
|
|
34
|
+
|
|
35
|
+
return [[RGLTCCParams alloc] initWithServiceTAURLString:serviceTAURLString servicePAURLString:servicePAURLString pfxCertURLString:pfxCertURLString pfxCertData: pfxCertData pfxPassPhrase:pfxPassPhrase];
|
|
36
|
+
}
|
|
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
|
+
|
|
28
52
|
+(NSMutableDictionary*)generateCGPoint:(CGPoint)input {
|
|
29
53
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
30
54
|
|
|
@@ -97,6 +121,9 @@
|
|
|
97
121
|
case RGLDocReaderActionError:
|
|
98
122
|
result = 3;
|
|
99
123
|
break;
|
|
124
|
+
case RGLDocReaderActionProcessTimeout:
|
|
125
|
+
result = 10;
|
|
126
|
+
break;
|
|
100
127
|
default:
|
|
101
128
|
break;
|
|
102
129
|
}
|
|
@@ -108,7 +135,7 @@
|
|
|
108
135
|
NSInteger result = 0;
|
|
109
136
|
switch (input) {
|
|
110
137
|
case RGLRFIDCompleteActionComplete:
|
|
111
|
-
result =
|
|
138
|
+
result = 999;
|
|
112
139
|
break;
|
|
113
140
|
case RGLRFIDCompleteActionError:
|
|
114
141
|
result = 3;
|
|
@@ -126,6 +153,29 @@
|
|
|
126
153
|
return result;
|
|
127
154
|
}
|
|
128
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
|
+
|
|
129
179
|
+(NSInteger)generateRFIDNotificationAction:(RGLRFIDNotificationAction)input {
|
|
130
180
|
return 5;
|
|
131
181
|
}
|
|
@@ -145,6 +195,9 @@
|
|
|
145
195
|
case 3:
|
|
146
196
|
result[@"results"] = [self generateRGLDocumentReaderResults:results];
|
|
147
197
|
break;
|
|
198
|
+
case 10:
|
|
199
|
+
result[@"results"] = [self generateRGLDocumentReaderResults:results];
|
|
200
|
+
break;
|
|
148
201
|
case 5:
|
|
149
202
|
result[@"results"] = [self generateResultsWithNotification:[self generateRGLRFIDNotify:notify]];
|
|
150
203
|
break;
|
|
@@ -154,7 +207,7 @@
|
|
|
154
207
|
case 8:
|
|
155
208
|
result[@"results"] = [self generateRGLDocumentReaderResults:results];
|
|
156
209
|
break;
|
|
157
|
-
case
|
|
210
|
+
case 999:
|
|
158
211
|
result[@"results"] = [self generateResultsWithRFID :results :1];
|
|
159
212
|
action = 1;
|
|
160
213
|
break;
|
|
@@ -390,7 +443,7 @@
|
|
|
390
443
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
391
444
|
if(input == nil) return result;
|
|
392
445
|
|
|
393
|
-
result[@"type"] =
|
|
446
|
+
result[@"type"] = [self generateRGLImageQualityCheckType:input.type];
|
|
394
447
|
result[@"result"] = @(input.result);
|
|
395
448
|
result[@"featureType"] = @(input.featureType);
|
|
396
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"])
|
|
@@ -236,22 +238,20 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
|
|
|
236
238
|
[self provideTASignature :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
237
239
|
else if([action isEqualToString:@"parseCoreResults"])
|
|
238
240
|
[self parseCoreResults :[args objectAtIndex:0] :successCallback :errorCallback];
|
|
239
|
-
else if([action isEqualToString:@"
|
|
240
|
-
[self
|
|
241
|
+
else if([action isEqualToString:@"setTCCParams"])
|
|
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)
|
|
278
|
-
[
|
|
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
|
}
|
|
@@ -316,10 +314,6 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
|
|
|
316
314
|
});
|
|
317
315
|
}
|
|
318
316
|
|
|
319
|
-
- (void) initializeReaderWithDatabasePath:(NSString*)licenseString :(NSString*)databasePath :(Callback)successCallback :(Callback)errorCallback{
|
|
320
|
-
[RGLDocReader.shared initializeReaderWithConfig:[RGLConfig configWithLicenseData:[[NSData alloc] initWithBase64EncodedString:licenseString options:0] licenseUpdateCheck:true databasePath:databasePath delayedNNLoadEnabled:false] completion:[self getInitCompletion :successCallback :errorCallback]];
|
|
321
|
-
}
|
|
322
|
-
|
|
323
317
|
- (void) prepareDatabase:(NSString*)dbID :(Callback)successCallback :(Callback)errorCallback{
|
|
324
318
|
[RGLDocReader.shared prepareDatabase:dbID progressHandler:[self getProgressHandler :successCallback :errorCallback] completion:[self getPrepareCompletion :successCallback :errorCallback]];
|
|
325
319
|
}
|
|
@@ -363,6 +357,15 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
|
|
|
363
357
|
});
|
|
364
358
|
}
|
|
365
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
|
+
|
|
366
369
|
- (void) recognizeImageWithCameraMode:(NSMutableString*)base64 :(BOOL)cameraMode :(Callback)successCallback :(Callback)errorCallback{
|
|
367
370
|
[self recognizeImageWith :base64 :cameraMode :successCallback :errorCallback];
|
|
368
371
|
}
|
|
@@ -502,6 +505,10 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
|
|
|
502
505
|
[self result:RGLDocReader.shared.documentReaderStatus :successCallback];
|
|
503
506
|
}
|
|
504
507
|
|
|
508
|
+
- (void) setTCCParams:(NSDictionary*)params :(Callback)successCallback :(Callback)errorCallback{
|
|
509
|
+
[RGLDocReader.shared setTCCParams:[RGLWJSONConstructor RGLTCCParamsFromJson:params] completion:[self getTCCParamsCompletion:successCallback :errorCallback]];
|
|
510
|
+
}
|
|
511
|
+
|
|
505
512
|
- (void) getRfidSessionStatus:(Callback)successCallback :(Callback)errorCallback{
|
|
506
513
|
[self result:RGLDocReader.shared.rfidSessionStatus :successCallback];
|
|
507
514
|
}
|
|
@@ -628,4 +635,13 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
|
|
|
628
635
|
};
|
|
629
636
|
}
|
|
630
637
|
|
|
638
|
+
-(void (^_Nullable)(BOOL success, NSError * _Nullable error))getTCCParamsCompletion:(Callback)successCallback :(Callback)errorCallback{
|
|
639
|
+
return ^(BOOL success, NSError * _Nullable error) {
|
|
640
|
+
if (success)
|
|
641
|
+
[self result:@"success" :successCallback];
|
|
642
|
+
else
|
|
643
|
+
[self result:[NSString stringWithFormat:@"%@/%@", @"failed: ", error.description] :errorCallback];
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
|
|
631
647
|
@end
|
package/ios/RegulaConfig.m
CHANGED
|
@@ -299,6 +299,12 @@
|
|
|
299
299
|
image.colornessCheck = [dict valueForKey:@"colornessCheck"];
|
|
300
300
|
if([dict valueForKey:@"moireCheck"] != nil)
|
|
301
301
|
image.moireCheck = [dict valueForKey:@"moireCheck"];
|
|
302
|
+
if([dict valueForKey:@"expectedPass"] != nil){
|
|
303
|
+
NSMutableArray<RGLImageQualityCheckType> *expectedPass = [NSMutableArray new];
|
|
304
|
+
for(NSString* str in [dict valueForKey:@"expectedPass"])
|
|
305
|
+
[expectedPass addObject:str];
|
|
306
|
+
image.expectedPass = expectedPass;
|
|
307
|
+
}
|
|
302
308
|
|
|
303
309
|
return image;
|
|
304
310
|
}
|
|
@@ -313,6 +319,7 @@
|
|
|
313
319
|
result[@"glaresCheck"] = input.glaresCheck;
|
|
314
320
|
result[@"colornessCheck"] = input.colornessCheck;
|
|
315
321
|
result[@"moireCheck"] = input.moireCheck;
|
|
322
|
+
result[@"expectedPass"] = input.expectedPass;
|
|
316
323
|
|
|
317
324
|
return result;
|
|
318
325
|
}
|
|
@@ -537,6 +544,14 @@
|
|
|
537
544
|
customization.toolbarSize = [[options valueForKey:@"toolbarSize"] floatValue];
|
|
538
545
|
if([options valueForKey:@"statusBackgroundColor"] != nil)
|
|
539
546
|
customization.statusBackgroundColor = [self getUIColorObjectFromHexString:[options valueForKey:@"statusBackgroundColor"] alpha:1];
|
|
547
|
+
if([options valueForKey:@"hologramAnimationImageContentMode"] != nil)
|
|
548
|
+
customization.hologramAnimationImageContentMode = [self UIViewContentModeWithNSInteger:[[options valueForKey:@"hologramAnimationImageContentMode"] integerValue]];
|
|
549
|
+
if([options valueForKey:@"hologramAnimationPositionMultiplier"] != nil)
|
|
550
|
+
customization.hologramAnimationPositionMultiplier = [[options valueForKey:@"hologramAnimationPositionMultiplier"] floatValue];
|
|
551
|
+
if([options valueForKey:@"hologramAnimationImage"] != nil)
|
|
552
|
+
customization.hologramAnimationImage = [self imageFromBase64:[options valueForKey:@"hologramAnimationImage"]];
|
|
553
|
+
if([options valueForKey:@"uiCustomizationLayer"] != nil)
|
|
554
|
+
customization.customUILayerJSON = [options valueForKey:@"uiCustomizationLayer"];
|
|
540
555
|
}
|
|
541
556
|
|
|
542
557
|
+(void)setFunctionality:(NSDictionary*)options :(RGLFunctionality*)functionality {
|
|
@@ -740,6 +755,10 @@
|
|
|
740
755
|
result[@"cameraFramePortraitAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFramePortraitAspectRatio];
|
|
741
756
|
result[@"cameraFrameLandscapeAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFrameLandscapeAspectRatio];
|
|
742
757
|
result[@"toolbarSize"] = [NSNumber numberWithFloat:customization.toolbarSize];
|
|
758
|
+
result[@"hologramAnimationImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.hologramAnimationImageContentMode]];
|
|
759
|
+
result[@"hologramAnimationPositionMultiplier"] = [NSNumber numberWithFloat:customization.hologramAnimationPositionMultiplier];
|
|
760
|
+
result[@"uiCustomizationLayer"] = customization.customUILayerJSON;
|
|
761
|
+
result[@"hologramAnimationImage"] = [UIImageJPEGRepresentation(customization.hologramAnimationImage, 1.0) base64EncodedStringWithOptions:0];
|
|
743
762
|
if(customization.customLabelStatus != nil)
|
|
744
763
|
result[@"customLabelStatus"] = customization.customLabelStatus.string;
|
|
745
764
|
if(customization.activityIndicatorColor != nil)
|
package/package.json
CHANGED