@regulaforensics/document-reader 8.2.186-beta → 8.2.204-beta
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/RNDocumentReader.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/documentreader/Config.kt +2 -0
- package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +6 -0
- package/examples/capacitor/package.json +1 -1
- package/examples/capacitor/src/extra/bt_device.tsx +2 -2
- package/examples/capacitor/src/extra/custom_rfid.tsx +29 -42
- package/examples/capacitor/src/main.tsx +85 -53
- package/examples/cordova/config.xml +3 -2
- package/examples/cordova/package.json +1 -1
- package/examples/cordova/www/images/portrait.png +0 -0
- package/examples/cordova/www/index.html +2 -17
- package/examples/cordova/www/index.js +40 -0
- package/examples/cordova/www/src/extra/bt_device.js +31 -0
- package/examples/cordova/www/src/extra/custom_rfid.js +60 -0
- package/examples/cordova/www/src/main.css +7 -6
- package/examples/cordova/www/src/main.html +10 -32
- package/examples/cordova/www/src/main.js +174 -22
- package/examples/ionic/config.xml +9 -4
- package/examples/ionic/index.ts +1 -2
- package/examples/ionic/package-lock.json +1862 -1638
- package/examples/ionic/package.json +1 -4
- package/examples/ionic/src/extra/bt_device.ts +32 -0
- package/examples/ionic/src/extra/custom_rfid.ts +61 -0
- package/examples/ionic/src/images/portrait.png +0 -0
- package/examples/ionic/src/main.css +7 -6
- package/examples/ionic/src/main.html +39 -61
- package/examples/ionic/src/main.ts +183 -36
- package/examples/react_native/app.config.ts +3 -1
- package/examples/react_native/images/portrait.png +0 -0
- package/examples/react_native/index.tsx +8 -2
- package/examples/react_native/package.json +1 -1
- package/examples/react_native/src/extra/bt_device.tsx +33 -0
- package/examples/react_native/src/extra/custom_rfid.tsx +62 -0
- package/examples/react_native/src/main.css +7 -6
- package/examples/react_native/src/main.html +10 -32
- package/examples/react_native/src/main.tsx +167 -21
- package/ios/RGLWConfig.m +2 -0
- package/ios/RGLWMain.m +10 -0
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/www/capacitor/index.js +16 -0
- package/www/capacitor/params/customization/Customization.js +7 -0
- package/www/capacitor/results/visual_results/FieldType.js +3 -1
- package/www/cordova.js +26 -1
- package/www/react-native/index.js +16 -0
- package/www/react-native/internal/bridge.js +1 -1
- package/www/react-native/params/customization/Customization.js +7 -0
- package/www/react-native/results/visual_results/FieldType.js +3 -1
- package/www/types/index.d.ts +6 -0
- package/www/types/params/customization/Customization.d.ts +5 -0
- package/www/types/results/visual_results/FieldType.d.ts +5 -1
|
@@ -88,10 +88,12 @@ body {
|
|
|
88
88
|
top: 1px;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
.radio {
|
|
92
|
+
align-items: baseline;
|
|
93
|
+
padding: 15px;
|
|
94
|
+
}
|
|
95
|
+
|
|
91
96
|
input[type="checkbox"] {
|
|
92
|
-
appearance: none;
|
|
93
|
-
-webkit-appearance: none;
|
|
94
|
-
-moz-appearance: none;
|
|
95
97
|
width: 20px;
|
|
96
98
|
height: 20px;
|
|
97
99
|
border: 2px solid black;
|
|
@@ -121,10 +123,9 @@ input[type="text"] {
|
|
|
121
123
|
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
|
122
124
|
}
|
|
123
125
|
|
|
124
|
-
|
|
126
|
+
#progress {
|
|
125
127
|
width: 0%;
|
|
126
128
|
height: 20px;
|
|
127
129
|
background-color: #4285F4;
|
|
128
130
|
border-radius: 5px;
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
+
}
|
|
@@ -7,45 +7,23 @@
|
|
|
7
7
|
<div class="row">
|
|
8
8
|
<div class="column" style="padding: 5px;">
|
|
9
9
|
<p>Portrait</p>
|
|
10
|
-
<img id="portrait-image" src="images/portrait.png" height="
|
|
10
|
+
<img id="portrait-image" src="images/portrait.png" height="160px" width="120px">
|
|
11
11
|
</div>
|
|
12
12
|
<div class="column" style="padding: 5px;">
|
|
13
13
|
<p>Document image</p>
|
|
14
|
-
<img id="document-image" src="images/document.png" height="
|
|
14
|
+
<img id="document-image" src="images/document.png" height="160px" width="200px">
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
|
-
<div id="scenario-container" class="column no-scroll"
|
|
18
|
-
style="margin-top: 15px; background-color: rgba(0, 0, 0, 0.03);">
|
|
19
|
-
<div id="scenarios" class="scroll">
|
|
20
|
-
<div class="row" style="align-items: baseline; padding: 15px;">
|
|
21
|
-
<input type="radio" name="scenario" value="Aaa">
|
|
22
|
-
<span style="width: 200px; padding-left: 5px;">Aaa</span>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="row" style="align-items: baseline; padding: 15px;">
|
|
25
|
-
<input type="radio" name="scenario" value="Aaa">
|
|
26
|
-
<span style="width: 200px; padding-left: 5px;">Aaa</span>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="row" style="align-items: baseline; padding: 15px;">
|
|
29
|
-
<input type="radio" name="scenario" value="Aaa">
|
|
30
|
-
<span style="width: 200px; padding-left: 5px;">Aaa</span>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="row" style="align-items: baseline; padding: 15px;">
|
|
33
|
-
<input type="radio" name="scenario" value="Aaa">
|
|
34
|
-
<span style="width: 200px; padding-left: 5px;">Aaa</span>
|
|
35
|
-
</div>
|
|
36
|
-
<div class="row" style="align-items: baseline; padding: 15px;">
|
|
37
|
-
<input type="radio" name="scenario" value="Aaa">
|
|
38
|
-
<span style="width: 200px; padding-left: 5px;">Aaa</span>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="row" style="width: 360px; padding-top: 15px;">
|
|
43
|
-
<span id="rfid-checkbox-description" style="font-size: 18px;">Process rfid reading</span>
|
|
44
|
-
<input id="rfid-checkbox" type="checkbox" style="margin-left: auto;" />
|
|
45
|
-
</div>
|
|
46
17
|
<div id="bt-device" class="row" style="display: none;">
|
|
47
18
|
<input type="text" placeholder="Regula 0000" />
|
|
48
|
-
<button class="button">Connect</button>
|
|
19
|
+
<button id="connect" class="button">Connect</button>
|
|
20
|
+
</div>
|
|
21
|
+
<div id="scenario-container" class="column no-scroll" style="margin-top: 15px; background-color: rgba(0, 0, 0, 0.03);">
|
|
22
|
+
<div id="scenarios" class="scroll"></div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="row" style="width: 360px; padding-top: 15px;">
|
|
25
|
+
<span id="rfid-checkbox-description" style="font-size: 18px;width: 100%;">Process rfid reading(unavailable)</span>
|
|
26
|
+
<input id="rfid-checkbox" type="checkbox" style="margin-left: auto;" disabled />
|
|
49
27
|
</div>
|
|
50
28
|
<div class="row">
|
|
51
29
|
<button id="scan" class="button">Scan document</button>
|
|
@@ -1,50 +1,196 @@
|
|
|
1
1
|
import { document } from '../index'
|
|
2
2
|
import * as RNFS from 'react-native-fs'
|
|
3
3
|
import { Platform } from 'react-native'
|
|
4
|
-
import {
|
|
4
|
+
import { launchImageLibrary } from 'react-native-image-picker'
|
|
5
|
+
|
|
6
|
+
import { DocumentReader, DocReaderAction, FieldType, GraphicFieldType, InitConfig, RecognizeConfig, ResultType, RFIDConfig, ScannerConfig, Scenario } from '@regulaforensics/document-reader'
|
|
7
|
+
import { setupBTDevice, useBtDevice } from './extra/bt_device'
|
|
8
|
+
import { useRfidSelfHostedUI, rfidSelfHostedUI } from './extra/custom_rfid'
|
|
5
9
|
|
|
6
10
|
var documentReader = DocumentReader.instance
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
11
|
+
var selectedScenario
|
|
12
|
+
var doRfid = false
|
|
13
|
+
var isReadingRfid = false
|
|
10
14
|
|
|
11
15
|
async function init() {
|
|
12
16
|
if (!await initialize()) return
|
|
17
|
+
setScenarios(documentReader.availableScenarios)
|
|
18
|
+
setCanRfid(await documentReader.isRFIDAvailableForUse())
|
|
13
19
|
setStatus("Ready")
|
|
14
20
|
}
|
|
15
21
|
|
|
22
|
+
async function scan() {
|
|
23
|
+
if (!await documentReader.isReady()) return
|
|
24
|
+
clearResults()
|
|
25
|
+
documentReader.startScanner(
|
|
26
|
+
ScannerConfig.withScenario(selectedScenario),
|
|
27
|
+
handleCompletion,
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function recognize() {
|
|
32
|
+
if (!await documentReader.isReady()) return
|
|
33
|
+
var image = await pickImage()
|
|
34
|
+
if (image == null) return
|
|
35
|
+
|
|
36
|
+
clearResults()
|
|
37
|
+
documentReader.recognize(
|
|
38
|
+
RecognizeConfig.withScenario(selectedScenario, { image: image }),
|
|
39
|
+
handleCompletion,
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function handleCompletion(action, results, error) {
|
|
44
|
+
handleException(error)
|
|
45
|
+
if (DocReaderAction.stopped(action) && !shouldRfid(results)) {
|
|
46
|
+
displayResults(results)
|
|
47
|
+
} else if (DocReaderAction.finished(action) && shouldRfid(results)) {
|
|
48
|
+
isReadingRfid = true
|
|
49
|
+
readRfid()
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export async function displayResults(results) {
|
|
54
|
+
isReadingRfid = false
|
|
55
|
+
clearResults()
|
|
56
|
+
if (results == null) return
|
|
57
|
+
|
|
58
|
+
var name = await results.textFieldValueByType(FieldType.SURNAME_AND_GIVEN_NAMES)
|
|
59
|
+
var docImage = await results.graphicFieldImageByType(GraphicFieldType.DOCUMENT_IMAGE)
|
|
60
|
+
var portrait = await results.graphicFieldImageByType(GraphicFieldType.PORTRAIT)
|
|
61
|
+
portrait = await results.graphicFieldImageByTypeSource(GraphicFieldType.PORTRAIT, ResultType.RFID_IMAGE_DATA) ?? portrait
|
|
62
|
+
|
|
63
|
+
setStatus(name)
|
|
64
|
+
setPortrait(portrait)
|
|
65
|
+
setDocImage(docImage)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var readRfid = () => {
|
|
69
|
+
documentReader.rfid(new RFIDConfig(handleCompletion))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function shouldRfid(results) {
|
|
73
|
+
return doRfid &&
|
|
74
|
+
!isReadingRfid &&
|
|
75
|
+
results != null && results.chipPage != 0
|
|
76
|
+
}
|
|
77
|
+
|
|
16
78
|
async function initialize() {
|
|
17
79
|
setStatus("Initializing...")
|
|
18
80
|
|
|
19
|
-
var license = await
|
|
20
|
-
var
|
|
21
|
-
var [success, error] = await documentReader.initialize(
|
|
81
|
+
var license = await loadAsset("regula.license")
|
|
82
|
+
var initConfig = new InitConfig(license)
|
|
83
|
+
var [success, error] = await documentReader.initialize(initConfig)
|
|
84
|
+
|
|
85
|
+
handleException(error)
|
|
86
|
+
return success
|
|
87
|
+
}
|
|
22
88
|
|
|
23
|
-
|
|
89
|
+
export function handleException(error) {
|
|
90
|
+
if (error != null) {
|
|
24
91
|
setStatus(error.message)
|
|
25
92
|
console.log(error.code + ": " + error.message)
|
|
26
93
|
}
|
|
27
|
-
return success
|
|
28
94
|
}
|
|
29
95
|
|
|
30
|
-
|
|
96
|
+
// ui --------------------------------------------------------------------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
export function setStatus(data) {
|
|
99
|
+
if (data != null)
|
|
100
|
+
document.getElementById("status").innerHTML = data
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function setPortrait(data) {
|
|
104
|
+
if (data != null)
|
|
105
|
+
portraitUIImage.src = "data:image/png;base64," + data
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function setDocImage(data) {
|
|
109
|
+
if (data != null)
|
|
110
|
+
documentUIImage.src = "data:image/png;base64," + data
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function clearResults() {
|
|
114
|
+
setStatus("Ready")
|
|
115
|
+
portraitUIImage.src = "images/portrait.png"
|
|
116
|
+
documentUIImage.src = "images/document.png"
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function setCanRfid(data) {
|
|
120
|
+
var checkbox // implicitly any, since cordova sample is pure js
|
|
121
|
+
checkbox = document.getElementById('rfid-checkbox')
|
|
122
|
+
var checkboxDescription = document.getElementById("rfid-checkbox-description")
|
|
123
|
+
if (data) {
|
|
124
|
+
checkbox.disabled = false
|
|
125
|
+
checkboxDescription.innerHTML = "Process rfid reading"
|
|
126
|
+
checkboxDescription.onclick = () => {
|
|
127
|
+
doRfid = !doRfid
|
|
128
|
+
checkbox.checked = doRfid
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// not equal --------------------------------------------------------------------------------------------------------------------
|
|
134
|
+
|
|
135
|
+
async function loadAsset(path: string): Promise<string> {
|
|
31
136
|
if (Platform.OS === 'ios') path = RNFS.MainBundlePath + "/" + path
|
|
32
137
|
var readFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileRes
|
|
33
|
-
|
|
34
|
-
return await readFile(path, 'base64')
|
|
35
|
-
} catch {
|
|
36
|
-
return null
|
|
37
|
-
}
|
|
138
|
+
return await readFile(path, 'base64')
|
|
38
139
|
}
|
|
39
140
|
|
|
40
|
-
|
|
141
|
+
async function pickImage(): Promise<string | null> {
|
|
142
|
+
var response = await launchImageLibrary({
|
|
143
|
+
mediaType: 'photo',
|
|
144
|
+
selectionLimit: 1,
|
|
145
|
+
includeBase64: true
|
|
146
|
+
})
|
|
147
|
+
return response?.assets?.[0].base64!
|
|
148
|
+
}
|
|
41
149
|
|
|
150
|
+
var documentUIImage
|
|
151
|
+
var portraitUIImage
|
|
42
152
|
export function onload() {
|
|
43
|
-
document.getElementById("
|
|
44
|
-
document.getElementById("
|
|
45
|
-
document.getElementById("
|
|
153
|
+
documentUIImage = document.getElementById("document-image")
|
|
154
|
+
portraitUIImage = document.getElementById("portrait-image")
|
|
155
|
+
document.getElementById("scan").onclick = () => scan()
|
|
156
|
+
document.getElementById("recognize").onclick = () => recognize()
|
|
157
|
+
|
|
158
|
+
// custom rfid
|
|
159
|
+
if (useRfidSelfHostedUI) readRfid = () => rfidSelfHostedUI()
|
|
160
|
+
|
|
161
|
+
// bt device
|
|
162
|
+
if (!useBtDevice) init()
|
|
163
|
+
else setupBTDevice()
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// not resolved --------------------------------------------------------------------------------------------------------------------
|
|
167
|
+
|
|
168
|
+
function setScenarios(data) {
|
|
169
|
+
selectedScenario = Scenario.MRZ
|
|
170
|
+
// const scenariosContainer = document.getElementById("scenarios")
|
|
171
|
+
// data.forEach(scenario => scenariosContainer.appendChild(createScenarioElement(scenario)))
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function createScenarioElement(scenario) {
|
|
175
|
+
// const div = document.createElement('div')
|
|
176
|
+
// div.className = 'row radio'
|
|
177
|
+
|
|
178
|
+
// const input = document.createElement('input')
|
|
179
|
+
// input.type = 'radio'
|
|
180
|
+
// input.name = 'scenario'
|
|
181
|
+
// input.value = scenario.name
|
|
182
|
+
// input.checked = scenario.name === selectedScenario
|
|
183
|
+
|
|
184
|
+
// const span = document.createElement('span')
|
|
185
|
+
// span.style.width = '200px'
|
|
186
|
+
// span.style.paddingLeft = '5px'
|
|
187
|
+
// span.textContent = scenario.caption
|
|
188
|
+
|
|
189
|
+
// input.onclick = () => selectedScenario = scenario.name
|
|
190
|
+
// span.onclick = () => input.click()
|
|
46
191
|
|
|
47
|
-
//
|
|
192
|
+
// div.appendChild(input)
|
|
193
|
+
// div.appendChild(span)
|
|
48
194
|
|
|
49
|
-
|
|
195
|
+
// return div
|
|
50
196
|
}
|
package/ios/RGLWConfig.m
CHANGED
|
@@ -475,6 +475,7 @@
|
|
|
475
475
|
customization.torchButtonOffImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOffImage"]];
|
|
476
476
|
if([options valueForKey:@"livenessAnimationImage"] != nil)
|
|
477
477
|
customization.livenessAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"livenessAnimationImage"]];
|
|
478
|
+
if(options[@"multipageButtonImage"]) customization.multipageButtonImage = [RGLWJSONConstructor imageWithBase64:options[@"multipageButtonImage"]];
|
|
478
479
|
|
|
479
480
|
// Font
|
|
480
481
|
if([options valueForKey:@"statusTextFont"] != nil)
|
|
@@ -576,6 +577,7 @@
|
|
|
576
577
|
result[@"torchButtonOnImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOnImage];
|
|
577
578
|
result[@"torchButtonOffImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOffImage];
|
|
578
579
|
result[@"livenessAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.livenessAnimationImage];
|
|
580
|
+
result[@"multipageButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageButtonImage];
|
|
579
581
|
|
|
580
582
|
// Font
|
|
581
583
|
result[@"statusTextFont"] = [self generateUIFont:customization.statusTextFont];
|
package/ios/RGLWMain.m
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
@"setTenant": ^{ [self setTenant :args[0]]; },
|
|
17
17
|
@"getEnv": ^{ [self getEnv :callback]; },
|
|
18
18
|
@"setEnv": ^{ [self setEnv :args[0]]; },
|
|
19
|
+
@"getLocale": ^{ [self getLocale :callback]; },
|
|
20
|
+
@"setLocale": ^{ [self setLocale :args[0]]; },
|
|
19
21
|
@"getFunctionality": ^{ [self getFunctionality :callback]; },
|
|
20
22
|
@"setFunctionality": ^{ [self setFunctionality :args[0]]; },
|
|
21
23
|
@"getProcessParams": ^{ [self getProcessParams :callback]; },
|
|
@@ -129,6 +131,14 @@ static NSDictionary* headers;
|
|
|
129
131
|
[RGLDocReader.shared setEnv:tag];
|
|
130
132
|
}
|
|
131
133
|
|
|
134
|
+
+(void)getLocale:(RGLWCallback)callback {
|
|
135
|
+
callback([RGLDocReader.shared languageLocaleCode]);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
+(void)setLocale:(NSString*)locale {
|
|
139
|
+
[RGLDocReader.shared setLanguageLocaleCode:locale];
|
|
140
|
+
}
|
|
141
|
+
|
|
132
142
|
+(void)getFunctionality:(RGLWCallback)callback {
|
|
133
143
|
callback([RGLWJSONConstructor dictToString: [RGLWConfig getFunctionality: RGLDocReader.shared.functionality]]);
|
|
134
144
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/document-reader",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.204-beta",
|
|
4
4
|
"description": "This is an npm module for Regula Document Reader SDK. It allows you to read various kinds of identification documents using your phone's camera.",
|
|
5
5
|
"main": "www/react-native/index.js",
|
|
6
6
|
"module": "www/capacitor/index.js",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/document-reader" version="8.2.
|
|
2
|
+
<plugin id="@regulaforensics/document-reader" version="8.2.204-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>DocumentReader</name>
|
|
4
4
|
<description>Cordova plugin for Regula Document Reader SDK</description>
|
|
5
5
|
<license>commercial</license>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<source url="https://github.com/CocoaPods/Specs.git" />
|
|
30
30
|
</config>
|
|
31
31
|
<pods>
|
|
32
|
-
<pod name="
|
|
32
|
+
<pod name="DocumentReaderStage" spec="8.2.4879" />
|
|
33
33
|
</pods>
|
|
34
34
|
</podspec>
|
|
35
35
|
</platform>
|
package/www/capacitor/index.js
CHANGED
|
@@ -184,6 +184,13 @@ export class DocumentReader {
|
|
|
184
184
|
this._setEnv(val);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
get locale() { return this._locale }
|
|
188
|
+
_locale = null
|
|
189
|
+
set locale(val) {
|
|
190
|
+
this._locale = val;
|
|
191
|
+
this._setLocale(val);
|
|
192
|
+
}
|
|
193
|
+
|
|
187
194
|
get localizationDictionary() { return this._localizationDictionary }
|
|
188
195
|
_localizationDictionary = null
|
|
189
196
|
set localizationDictionary(val) {
|
|
@@ -379,6 +386,7 @@ export class DocumentReader {
|
|
|
379
386
|
this._tag = await this._getTag();
|
|
380
387
|
this._tenant = await this._getTenant();
|
|
381
388
|
this._env = await this._getEnv();
|
|
389
|
+
this._locale = await this._getLocale();
|
|
382
390
|
this._rfidSessionStatus = await this._getRfidSessionStatus();
|
|
383
391
|
this._functionality = await this._getFunctionality();
|
|
384
392
|
this._processParams = await this._getProcessParams();
|
|
@@ -457,6 +465,14 @@ export class DocumentReader {
|
|
|
457
465
|
exec("setEnv", [env]);
|
|
458
466
|
}
|
|
459
467
|
|
|
468
|
+
async _getLocale() {
|
|
469
|
+
return await exec("getLocale", []);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
_setLocale(locale) {
|
|
473
|
+
exec("setLocale", [locale]);
|
|
474
|
+
}
|
|
475
|
+
|
|
460
476
|
_setLocalizationDictionary(dictionary) {
|
|
461
477
|
exec("setLocalizationDictionary", [dictionary]);
|
|
462
478
|
}
|
|
@@ -312,6 +312,12 @@ export class Customization {
|
|
|
312
312
|
this._set({ "livenessAnimationImage": val });
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
get multipageButtonImage() { return this._multipageButtonImage; }
|
|
316
|
+
set multipageButtonImage(val) {
|
|
317
|
+
this._multipageButtonImage = val;
|
|
318
|
+
this._set({ "multipageButtonImage": val });
|
|
319
|
+
}
|
|
320
|
+
|
|
315
321
|
get statusTextFont() { return this._statusTextFont; }
|
|
316
322
|
set statusTextFont(val) {
|
|
317
323
|
this._statusTextFont = val;
|
|
@@ -482,6 +488,7 @@ export class Customization {
|
|
|
482
488
|
result._changeFrameButtonExpandImage = jsonObject["changeFrameButtonExpandImage"];
|
|
483
489
|
result._changeFrameButtonCollapseImage = jsonObject["changeFrameButtonCollapseImage"];
|
|
484
490
|
result._livenessAnimationImage = jsonObject["livenessAnimationImage"];
|
|
491
|
+
result._multipageButtonImage = jsonObject["multipageButtonImage"];
|
|
485
492
|
result._customLabelStatus = jsonObject["customLabelStatus"];
|
|
486
493
|
result._cameraFrameLineCap = jsonObject["cameraFrameLineCap"];
|
|
487
494
|
result._uiCustomizationLayer = jsonObject["uiCustomizationLayer"];
|
|
@@ -650,7 +650,9 @@ export const FieldType = {
|
|
|
650
650
|
AIRLINE_CODE: 694,
|
|
651
651
|
MVC_AGENCY: 695,
|
|
652
652
|
ISSUING_STATE_CODE_ALPHA_2: 696,
|
|
653
|
-
NATIONALITY_CODE_ALPHA_2: 697
|
|
653
|
+
NATIONALITY_CODE_ALPHA_2: 697,
|
|
654
|
+
FIRST_ISSUE_DATE_CHECKDIGIT: 698,
|
|
655
|
+
FIRST_ISSUE_DATE_CHECKSUM: 699,
|
|
654
656
|
}
|
|
655
657
|
|
|
656
658
|
FieldType.getTranslation = async function (value) {
|
package/www/cordova.js
CHANGED
|
@@ -759,6 +759,13 @@ class DocumentReader {
|
|
|
759
759
|
this._setEnv(val);
|
|
760
760
|
}
|
|
761
761
|
|
|
762
|
+
get locale() { return this._locale }
|
|
763
|
+
_locale = null
|
|
764
|
+
set locale(val) {
|
|
765
|
+
this._locale = val;
|
|
766
|
+
this._setLocale(val);
|
|
767
|
+
}
|
|
768
|
+
|
|
762
769
|
get localizationDictionary() { return this._localizationDictionary }
|
|
763
770
|
_localizationDictionary = null
|
|
764
771
|
set localizationDictionary(val) {
|
|
@@ -954,6 +961,7 @@ class DocumentReader {
|
|
|
954
961
|
this._tag = await this._getTag();
|
|
955
962
|
this._tenant = await this._getTenant();
|
|
956
963
|
this._env = await this._getEnv();
|
|
964
|
+
this._locale = await this._getLocale();
|
|
957
965
|
this._rfidSessionStatus = await this._getRfidSessionStatus();
|
|
958
966
|
this._functionality = await this._getFunctionality();
|
|
959
967
|
this._processParams = await this._getProcessParams();
|
|
@@ -1032,6 +1040,14 @@ class DocumentReader {
|
|
|
1032
1040
|
(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)("setEnv", [env]);
|
|
1033
1041
|
}
|
|
1034
1042
|
|
|
1043
|
+
async _getLocale() {
|
|
1044
|
+
return await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)("getLocale", []);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
_setLocale(locale) {
|
|
1048
|
+
(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)("setLocale", [locale]);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1035
1051
|
_setLocalizationDictionary(dictionary) {
|
|
1036
1052
|
(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)("setLocalizationDictionary", [dictionary]);
|
|
1037
1053
|
}
|
|
@@ -2230,6 +2246,12 @@ class Customization {
|
|
|
2230
2246
|
this._set({ "livenessAnimationImage": val });
|
|
2231
2247
|
}
|
|
2232
2248
|
|
|
2249
|
+
get multipageButtonImage() { return this._multipageButtonImage; }
|
|
2250
|
+
set multipageButtonImage(val) {
|
|
2251
|
+
this._multipageButtonImage = val;
|
|
2252
|
+
this._set({ "multipageButtonImage": val });
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2233
2255
|
get statusTextFont() { return this._statusTextFont; }
|
|
2234
2256
|
set statusTextFont(val) {
|
|
2235
2257
|
this._statusTextFont = val;
|
|
@@ -2400,6 +2422,7 @@ class Customization {
|
|
|
2400
2422
|
result._changeFrameButtonExpandImage = jsonObject["changeFrameButtonExpandImage"];
|
|
2401
2423
|
result._changeFrameButtonCollapseImage = jsonObject["changeFrameButtonCollapseImage"];
|
|
2402
2424
|
result._livenessAnimationImage = jsonObject["livenessAnimationImage"];
|
|
2425
|
+
result._multipageButtonImage = jsonObject["multipageButtonImage"];
|
|
2403
2426
|
result._customLabelStatus = jsonObject["customLabelStatus"];
|
|
2404
2427
|
result._cameraFrameLineCap = jsonObject["cameraFrameLineCap"];
|
|
2405
2428
|
result._uiCustomizationLayer = jsonObject["uiCustomizationLayer"];
|
|
@@ -8608,7 +8631,9 @@ const FieldType = {
|
|
|
8608
8631
|
AIRLINE_CODE: 694,
|
|
8609
8632
|
MVC_AGENCY: 695,
|
|
8610
8633
|
ISSUING_STATE_CODE_ALPHA_2: 696,
|
|
8611
|
-
NATIONALITY_CODE_ALPHA_2: 697
|
|
8634
|
+
NATIONALITY_CODE_ALPHA_2: 697,
|
|
8635
|
+
FIRST_ISSUE_DATE_CHECKDIGIT: 698,
|
|
8636
|
+
FIRST_ISSUE_DATE_CHECKSUM: 699,
|
|
8612
8637
|
}
|
|
8613
8638
|
|
|
8614
8639
|
FieldType.getTranslation = async function (value) {
|
|
@@ -184,6 +184,13 @@ export class DocumentReader {
|
|
|
184
184
|
this._setEnv(val);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
get locale() { return this._locale }
|
|
188
|
+
_locale = null
|
|
189
|
+
set locale(val) {
|
|
190
|
+
this._locale = val;
|
|
191
|
+
this._setLocale(val);
|
|
192
|
+
}
|
|
193
|
+
|
|
187
194
|
get localizationDictionary() { return this._localizationDictionary }
|
|
188
195
|
_localizationDictionary = null
|
|
189
196
|
set localizationDictionary(val) {
|
|
@@ -379,6 +386,7 @@ export class DocumentReader {
|
|
|
379
386
|
this._tag = await this._getTag();
|
|
380
387
|
this._tenant = await this._getTenant();
|
|
381
388
|
this._env = await this._getEnv();
|
|
389
|
+
this._locale = await this._getLocale();
|
|
382
390
|
this._rfidSessionStatus = await this._getRfidSessionStatus();
|
|
383
391
|
this._functionality = await this._getFunctionality();
|
|
384
392
|
this._processParams = await this._getProcessParams();
|
|
@@ -457,6 +465,14 @@ export class DocumentReader {
|
|
|
457
465
|
exec("setEnv", [env]);
|
|
458
466
|
}
|
|
459
467
|
|
|
468
|
+
async _getLocale() {
|
|
469
|
+
return await exec("getLocale", []);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
_setLocale(locale) {
|
|
473
|
+
exec("setLocale", [locale]);
|
|
474
|
+
}
|
|
475
|
+
|
|
460
476
|
_setLocalizationDictionary(dictionary) {
|
|
461
477
|
exec("setLocalizationDictionary", [dictionary]);
|
|
462
478
|
}
|
|
@@ -312,6 +312,12 @@ export class Customization {
|
|
|
312
312
|
this._set({ "livenessAnimationImage": val });
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
get multipageButtonImage() { return this._multipageButtonImage; }
|
|
316
|
+
set multipageButtonImage(val) {
|
|
317
|
+
this._multipageButtonImage = val;
|
|
318
|
+
this._set({ "multipageButtonImage": val });
|
|
319
|
+
}
|
|
320
|
+
|
|
315
321
|
get statusTextFont() { return this._statusTextFont; }
|
|
316
322
|
set statusTextFont(val) {
|
|
317
323
|
this._statusTextFont = val;
|
|
@@ -482,6 +488,7 @@ export class Customization {
|
|
|
482
488
|
result._changeFrameButtonExpandImage = jsonObject["changeFrameButtonExpandImage"];
|
|
483
489
|
result._changeFrameButtonCollapseImage = jsonObject["changeFrameButtonCollapseImage"];
|
|
484
490
|
result._livenessAnimationImage = jsonObject["livenessAnimationImage"];
|
|
491
|
+
result._multipageButtonImage = jsonObject["multipageButtonImage"];
|
|
485
492
|
result._customLabelStatus = jsonObject["customLabelStatus"];
|
|
486
493
|
result._cameraFrameLineCap = jsonObject["cameraFrameLineCap"];
|
|
487
494
|
result._uiCustomizationLayer = jsonObject["uiCustomizationLayer"];
|
|
@@ -650,7 +650,9 @@ export const FieldType = {
|
|
|
650
650
|
AIRLINE_CODE: 694,
|
|
651
651
|
MVC_AGENCY: 695,
|
|
652
652
|
ISSUING_STATE_CODE_ALPHA_2: 696,
|
|
653
|
-
NATIONALITY_CODE_ALPHA_2: 697
|
|
653
|
+
NATIONALITY_CODE_ALPHA_2: 697,
|
|
654
|
+
FIRST_ISSUE_DATE_CHECKDIGIT: 698,
|
|
655
|
+
FIRST_ISSUE_DATE_CHECKSUM: 699,
|
|
654
656
|
}
|
|
655
657
|
|
|
656
658
|
FieldType.getTranslation = async function (value) {
|
package/www/types/index.d.ts
CHANGED
|
@@ -187,6 +187,12 @@ export class DocumentReader {
|
|
|
187
187
|
/** Environment type. */
|
|
188
188
|
env: string | null;
|
|
189
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Custom language locale code of DocumentReaderSDK.
|
|
192
|
+
* If empty or doesn't exist - app language is used. Format "en-US" or "en".
|
|
193
|
+
*/
|
|
194
|
+
locale: string | null;
|
|
195
|
+
|
|
190
196
|
/**
|
|
191
197
|
* A localization dictionary to override default localization logic.
|
|
192
198
|
* Allows to replace any string of DocumentReader SDK with an arbitrary string.
|
|
@@ -342,6 +342,11 @@ export declare class Customization {
|
|
|
342
342
|
*/
|
|
343
343
|
livenessAnimationImage?: string;
|
|
344
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Allows you to set any UIImage for the "Skip next page" button.
|
|
347
|
+
*/
|
|
348
|
+
multipageButtonImage?: string;
|
|
349
|
+
|
|
345
350
|
/**
|
|
346
351
|
* Allows you to set a font for the status messages.
|
|
347
352
|
*/
|
|
@@ -1302,7 +1302,11 @@ export declare enum FieldType {
|
|
|
1302
1302
|
/** Issuing state code alpha 2. */
|
|
1303
1303
|
ISSUING_STATE_CODE_ALPHA_2 = 696,
|
|
1304
1304
|
/** Nationality code alpha 2. */
|
|
1305
|
-
NATIONALITY_CODE_ALPHA_2 = 697
|
|
1305
|
+
NATIONALITY_CODE_ALPHA_2 = 697,
|
|
1306
|
+
/** First issue date check digit. */
|
|
1307
|
+
FIRST_ISSUE_DATE_CHECKDIGIT = 698,
|
|
1308
|
+
/** First issue date checksum. */
|
|
1309
|
+
FIRST_ISSUE_DATE_CHECKSUM = 699,
|
|
1306
1310
|
}
|
|
1307
1311
|
|
|
1308
1312
|
export declare namespace FieldType {
|