@regulaforensics/ionic-native-document-reader 6.4.0 → 6.5.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/example/package.json +10 -10
- package/example/src/app/app.component.spec.ts +2 -2
- package/example/src/app/app.component.ts +2 -2
- package/example/src/app/app.module.ts +2 -2
- package/example/src/app/home/home.module.ts +2 -2
- package/example/src/app/home/home.page.ts +24 -24
- package/index.d.ts +3571 -3511
- package/index.js +3492 -3355
- package/ngx/index.d.ts +3571 -3511
- package/ngx/index.js +3492 -3355
- package/ngx/index.metadata.json +1 -1
- package/package.json +1 -1
- package/reactExample/package.json +8 -8
- package/reactExample/src/pages/Home.tsx +40 -39
package/example/package.json
CHANGED
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
"@angular/platform-browser": "~13.3.2",
|
|
20
20
|
"@angular/platform-browser-dynamic": "~13.3.2",
|
|
21
21
|
"@angular/router": "~13.3.2",
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
22
|
+
"@awesome-cordova-plugins/android-permissions": "^5.28.0",
|
|
23
|
+
"@awesome-cordova-plugins/core": "^5.28.0",
|
|
24
|
+
"@awesome-cordova-plugins/file": "^5.28.0",
|
|
25
|
+
"@awesome-cordova-plugins/image-picker": "^5.28.0",
|
|
26
|
+
"@awesome-cordova-plugins/splash-screen": "^5.28.0",
|
|
27
|
+
"@awesome-cordova-plugins/status-bar": "^5.28.0",
|
|
28
28
|
"@ionic/angular": "^6.0.15",
|
|
29
29
|
"@ionic/cordova-builders": "^6.1.0",
|
|
30
30
|
"cordova-ios": "^6.2.0",
|
|
31
|
-
"@regulaforensics/cordova-plugin-document-reader-api": "
|
|
32
|
-
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "
|
|
33
|
-
"@regulaforensics/ionic-native-document-reader": "
|
|
31
|
+
"@regulaforensics/cordova-plugin-document-reader-api": "6.5.0",
|
|
32
|
+
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "6.5.0",
|
|
33
|
+
"@regulaforensics/ionic-native-document-reader": "6.5.0",
|
|
34
34
|
"cordova-android": "^10.1.1",
|
|
35
35
|
"cordova-plugin-add-swift-support": "^2.0.2",
|
|
36
36
|
"cordova-plugin-android-permissions": "^1.1.0",
|
|
@@ -98,4 +98,4 @@
|
|
|
98
98
|
"ios"
|
|
99
99
|
]
|
|
100
100
|
}
|
|
101
|
-
}
|
|
101
|
+
}
|
|
@@ -2,8 +2,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
|
2
2
|
import { TestBed, async } from '@angular/core/testing';
|
|
3
3
|
|
|
4
4
|
import { Platform } from '@ionic/angular';
|
|
5
|
-
import { SplashScreen } from '@
|
|
6
|
-
import { StatusBar } from '@
|
|
5
|
+
import { SplashScreen } from '@awesome-cordova-plugins/splash-screen/ngx';
|
|
6
|
+
import { StatusBar } from '@awesome-cordova-plugins/status-bar/ngx';
|
|
7
7
|
|
|
8
8
|
import { AppComponent } from './app.component';
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Component } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
import { Platform } from '@ionic/angular';
|
|
4
|
-
import { SplashScreen } from '@
|
|
5
|
-
import { StatusBar } from '@
|
|
4
|
+
import { SplashScreen } from '@awesome-cordova-plugins/splash-screen/ngx';
|
|
5
|
+
import { StatusBar } from '@awesome-cordova-plugins/status-bar/ngx';
|
|
6
6
|
|
|
7
7
|
@Component({
|
|
8
8
|
selector: 'app-root',
|
|
@@ -3,8 +3,8 @@ import { BrowserModule } from '@angular/platform-browser';
|
|
|
3
3
|
import { RouteReuseStrategy } from '@angular/router';
|
|
4
4
|
|
|
5
5
|
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
|
6
|
-
import { SplashScreen } from '@
|
|
7
|
-
import { StatusBar } from '@
|
|
6
|
+
import { SplashScreen } from '@awesome-cordova-plugins/splash-screen/ngx';
|
|
7
|
+
import { StatusBar } from '@awesome-cordova-plugins/status-bar/ngx';
|
|
8
8
|
|
|
9
9
|
import { AppComponent } from './app.component';
|
|
10
10
|
import { AppRoutingModule } from './app-routing.module';
|
|
@@ -3,8 +3,8 @@ import { CommonModule } from '@angular/common';
|
|
|
3
3
|
import { IonicModule } from '@ionic/angular';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import { RouterModule } from '@angular/router';
|
|
6
|
-
import { ImagePicker } from "@
|
|
7
|
-
import { AndroidPermissions } from '@
|
|
6
|
+
import { ImagePicker } from "@awesome-cordova-plugins/image-picker/ngx";
|
|
7
|
+
import { AndroidPermissions } from '@awesome-cordova-plugins/android-permissions/ngx';
|
|
8
8
|
import { DocumentReader } from '@regulaforensics/ionic-native-document-reader/ngx';
|
|
9
9
|
|
|
10
10
|
import { HomePage } from './home.page';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Component, ViewChild, ElementRef } from '@angular/core'
|
|
2
|
-
import { File } from '@
|
|
3
|
-
import { ImagePicker } from '@
|
|
4
|
-
import { AndroidPermissions } from '@
|
|
2
|
+
import { File } from '@awesome-cordova-plugins/file'
|
|
3
|
+
import { ImagePicker } from '@awesome-cordova-plugins/image-picker/ngx'
|
|
4
|
+
import { AndroidPermissions } from '@awesome-cordova-plugins/android-permissions/ngx'
|
|
5
5
|
import { Platform } from '@ionic/angular'
|
|
6
6
|
import { DocumentReader, DocumentReaderScenario, Enum, DocumentReaderCompletion, DocumentReaderResults, DocumentReaderNotification } from '@regulaforensics/ionic-native-document-reader/ngx';
|
|
7
7
|
|
|
8
8
|
var doRfid: boolean = false
|
|
9
|
+
var isReadingRfidCustomUi: boolean = false
|
|
9
10
|
var isReadingRfid: boolean = false
|
|
10
11
|
var rfidUIHeader: string = "Reading RFID"
|
|
11
12
|
var rfidUIHeaderColor: string = "black"
|
|
@@ -62,7 +63,10 @@ export class HomePage {
|
|
|
62
63
|
app.status.nativeElement.innerHTML = "Downloading database: " + r + "%"
|
|
63
64
|
else {
|
|
64
65
|
app.status.nativeElement.innerHTML = "Loading......"
|
|
65
|
-
DocumentReader.initializeReader(
|
|
66
|
+
DocumentReader.initializeReader({
|
|
67
|
+
license: license,
|
|
68
|
+
delayedNNLoad: true
|
|
69
|
+
}).then(m => onInitialized()).catch(error1)
|
|
66
70
|
}
|
|
67
71
|
})
|
|
68
72
|
})
|
|
@@ -105,8 +109,8 @@ export class HomePage {
|
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
function updateUI() {
|
|
108
|
-
app.mainUI.nativeElement.style.display =
|
|
109
|
-
app.rfidUI.nativeElement.style.display =
|
|
112
|
+
app.mainUI.nativeElement.style.display = isReadingRfidCustomUi ? "none" : ""
|
|
113
|
+
app.rfidUI.nativeElement.style.display = isReadingRfidCustomUi ? "" : "none"
|
|
110
114
|
app.rfidUIHeader.nativeElement.innerHTML = rfidUIHeader
|
|
111
115
|
app.rfidUIHeader.nativeElement.style.color = rfidUIHeaderColor
|
|
112
116
|
app.rfidDescription.nativeElement.innerHTML = rfidDescription
|
|
@@ -119,12 +123,12 @@ export class HomePage {
|
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
function handleCompletion(completion: DocumentReaderCompletion) {
|
|
122
|
-
if (
|
|
126
|
+
if (isReadingRfidCustomUi && (completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR))
|
|
123
127
|
hideRfidUI()
|
|
124
|
-
if (
|
|
128
|
+
if (isReadingRfidCustomUi && completion.action === Enum.DocReaderAction.NOTIFICATION)
|
|
125
129
|
updateRfidUI(completion.results.documentReaderNotification)
|
|
126
130
|
if (completion.action === Enum.DocReaderAction.COMPLETE)
|
|
127
|
-
if (
|
|
131
|
+
if (isReadingRfidCustomUi) {
|
|
128
132
|
if (completion.results.rfidResult !== 1)
|
|
129
133
|
restartRfidUI()
|
|
130
134
|
else {
|
|
@@ -134,18 +138,22 @@ export class HomePage {
|
|
|
134
138
|
}
|
|
135
139
|
else
|
|
136
140
|
handleResults(completion.results)
|
|
141
|
+
if (completion.action === Enum.DocReaderAction.TIMEOUT)
|
|
142
|
+
handleResults(completion.results)
|
|
143
|
+
if (completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR)
|
|
144
|
+
isReadingRfid = false
|
|
137
145
|
}
|
|
138
146
|
|
|
139
147
|
function showRfidUI() {
|
|
140
148
|
// show animation
|
|
141
|
-
|
|
149
|
+
isReadingRfidCustomUi = true
|
|
142
150
|
updateUI()
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
function hideRfidUI() {
|
|
146
154
|
// show animation
|
|
147
155
|
restartRfidUI()
|
|
148
|
-
|
|
156
|
+
isReadingRfidCustomUi = false
|
|
149
157
|
rfidUIHeader = "Reading RFID"
|
|
150
158
|
rfidUIHeaderColor = "black"
|
|
151
159
|
updateUI()
|
|
@@ -177,8 +185,7 @@ export class HomePage {
|
|
|
177
185
|
}
|
|
178
186
|
|
|
179
187
|
function usualRFID() {
|
|
180
|
-
|
|
181
|
-
app.rfidCheckbox["el"].checked = false
|
|
188
|
+
isReadingRfid = true
|
|
182
189
|
var notification = "rfidNotificationCompletionEvent"
|
|
183
190
|
var paCert = "paCertificateCompletionEvent"
|
|
184
191
|
var taCert = "taCertificateCompletionEvent"
|
|
@@ -264,20 +271,13 @@ export class HomePage {
|
|
|
264
271
|
|
|
265
272
|
function handleResults(results: DocumentReaderResults) {
|
|
266
273
|
clearResults()
|
|
267
|
-
if (doRfid && results != null && results.chipPage != 0) {
|
|
268
|
-
var accessKey = results.getTextFieldValueByType({ fieldType: 51 })
|
|
269
|
-
if (accessKey != null && accessKey != "") {
|
|
270
|
-
accessKey = accessKey.replace(/^/g, '').replace(/\n/g, '')
|
|
271
|
-
DocumentReader.setRfidScenario({ mMrz: accessKey, mPacePasswordType: 1, })
|
|
272
|
-
} else {
|
|
273
|
-
accessKey = results.getTextFieldValueByType({ fieldType: 159 })
|
|
274
|
-
if (accessKey != null && accessKey != "")
|
|
275
|
-
DocumentReader.setRfidScenario({ mMrz: accessKey, mPacePasswordType: 2, })
|
|
276
|
-
}
|
|
274
|
+
if (doRfid && !isReadingRfid && results != null && results.chipPage != 0) {
|
|
277
275
|
// customRFID()
|
|
278
276
|
usualRFID()
|
|
279
|
-
} else
|
|
277
|
+
} else {
|
|
278
|
+
isReadingRfid = false
|
|
280
279
|
displayResults(results)
|
|
280
|
+
}
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
function displayResults(results: DocumentReaderResults) {
|