@regulaforensics/react-native-document-reader-api 8.3.201-beta → 8.3.203-nightly
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/RNDocumentReaderApi.podspec +1 -1
- package/android/build.gradle +2 -2
- package/example/App.tsx +30 -17
- package/example/package.json +2 -2
- package/package.json +1 -1
|
@@ -14,6 +14,6 @@ Pod::Spec.new do |s|
|
|
|
14
14
|
s.source = { :http => 'file:' + __dir__ }
|
|
15
15
|
s.ios.deployment_target = '13.0'
|
|
16
16
|
s.source_files = "ios/*.{h,m}"
|
|
17
|
-
s.dependency '
|
|
17
|
+
s.dependency 'DocumentReaderNightly', '8.3.4956'
|
|
18
18
|
s.dependency 'React'
|
|
19
19
|
end
|
package/android/build.gradle
CHANGED
|
@@ -32,7 +32,7 @@ android {
|
|
|
32
32
|
rootProject.allprojects {
|
|
33
33
|
repositories {
|
|
34
34
|
maven {
|
|
35
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
35
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -41,7 +41,7 @@ dependencies {
|
|
|
41
41
|
//noinspection GradleDynamicVersion
|
|
42
42
|
implementation 'com.facebook.react:react-native:+'
|
|
43
43
|
//noinspection GradleDependency
|
|
44
|
-
implementation('com.regula.documentreader:api:8.
|
|
44
|
+
implementation('com.regula.documentreader:api:8.3.11703') {
|
|
45
45
|
transitive = true
|
|
46
46
|
}
|
|
47
47
|
}
|
package/example/App.tsx
CHANGED
|
@@ -8,10 +8,6 @@ import Icon from 'react-native-vector-icons/FontAwesome'
|
|
|
8
8
|
import { launchImageLibrary } from 'react-native-image-picker'
|
|
9
9
|
import * as Progress from 'react-native-progress'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
// Example of how to get MRZ string is on line 174
|
|
13
|
-
const MRZ_STRING = "PLACE YOUR MRZ STRING HERE"
|
|
14
|
-
|
|
15
11
|
var isReadingRfid = false
|
|
16
12
|
|
|
17
13
|
interface IProps {
|
|
@@ -40,11 +36,6 @@ export default class App extends React.Component<IProps, IState> {
|
|
|
40
36
|
var functionality = new Functionality()
|
|
41
37
|
functionality.showCaptureButton = true
|
|
42
38
|
DocumentReader.setFunctionality(functionality, _ => { }, _ => { })
|
|
43
|
-
|
|
44
|
-
DocumentReader.setRfidScenario({
|
|
45
|
-
mrz: MRZ_STRING,
|
|
46
|
-
pacePasswordType: Enum.eRFID_Password_Type.PPT_MRZ,
|
|
47
|
-
}, _ => { }, _ => { })
|
|
48
39
|
}
|
|
49
40
|
|
|
50
41
|
constructor(props: {} | Readonly<{}>) {
|
|
@@ -163,18 +154,40 @@ export default class App extends React.Component<IProps, IState> {
|
|
|
163
154
|
DocumentReader.startScanner(config, _ => { }, e => console.log(e))
|
|
164
155
|
}
|
|
165
156
|
|
|
166
|
-
|
|
167
|
-
|
|
157
|
+
recognize() {
|
|
158
|
+
launchImageLibrary({
|
|
159
|
+
mediaType: 'photo',
|
|
160
|
+
includeBase64: true,
|
|
161
|
+
selectionLimit: 10
|
|
162
|
+
}, r => {
|
|
163
|
+
if (r.errorCode != null) {
|
|
164
|
+
console.log("error code: " + r.errorCode)
|
|
165
|
+
console.log("error message: " + r.errorMessage)
|
|
166
|
+
this.setState({ fullName: r.errorMessage })
|
|
167
|
+
return
|
|
168
|
+
}
|
|
169
|
+
if (r.didCancel) return
|
|
170
|
+
this.clearResults()
|
|
171
|
+
this.setState({ fullName: "COPYING IMAGE..." })
|
|
172
|
+
var response = r.assets
|
|
173
|
+
|
|
174
|
+
var images: any = []
|
|
175
|
+
|
|
176
|
+
for (var i = 0; i < response!.length; i++) {
|
|
177
|
+
images.push(response![i].base64!)
|
|
178
|
+
}
|
|
179
|
+
this.setState({ fullName: "PROCESSING..." })
|
|
180
|
+
|
|
181
|
+
var config = new RecognizeConfig()
|
|
182
|
+
config.scenario = this.state.selectedScenario
|
|
183
|
+
config.images = images
|
|
184
|
+
DocumentReader.recognize(config, _ => { }, e => console.log(e))
|
|
185
|
+
})
|
|
168
186
|
}
|
|
169
187
|
|
|
170
188
|
displayResults(results: DocumentReaderResults) {
|
|
171
189
|
if (results == null) return
|
|
172
190
|
|
|
173
|
-
// Here is how you can aquire the MRZ string
|
|
174
|
-
// results.textFieldValueByType(Enum.eVisualFieldType.FT_MRZ_STRINGS, (value: string | undefined) => {
|
|
175
|
-
// console.log("MRZ: " + value)
|
|
176
|
-
// }, _ => { })
|
|
177
|
-
|
|
178
191
|
results.textFieldValueByType(Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, (value: string | undefined) => {
|
|
179
192
|
this.setState({ fullName: value })
|
|
180
193
|
}, (error: string) => console.log(error))
|
|
@@ -256,7 +269,7 @@ export default class App extends React.Component<IProps, IState> {
|
|
|
256
269
|
<View style={{ flexDirection: 'row' }}>
|
|
257
270
|
<Button color="#4285F4" title="Scan document" onPress={() => this.scan()} />
|
|
258
271
|
<Text style={{ padding: 5 }}></Text>
|
|
259
|
-
<Button color="#4285F4" title="Scan image" onPress={() => this.
|
|
272
|
+
<Button color="#4285F4" title="Scan image" onPress={() => this.recognize()} />
|
|
260
273
|
</View>
|
|
261
274
|
</View>}
|
|
262
275
|
|
package/example/package.json
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"test": "jest"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@regulaforensics/react-native-document-reader-api": "8.3.
|
|
14
|
-
"@regulaforensics/react-native-document-reader-core-fullauthrfid": "8.
|
|
13
|
+
"@regulaforensics/react-native-document-reader-api": "8.3.203-nightly",
|
|
14
|
+
"@regulaforensics/react-native-document-reader-core-fullauthrfid": "8.3.611-nightly",
|
|
15
15
|
"react-native-progress": "5.0.0",
|
|
16
16
|
"react-native-radio-buttons-group": "3.0.5",
|
|
17
17
|
"@rneui/base": "4.0.0-rc.7",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/react-native-document-reader-api",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.203-nightly",
|
|
4
4
|
"description": "React Native module for reading and validation of identification documents (API framework)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|