@regulaforensics/ionic-native-document-reader 6.3.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.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Create a report to help us improve
4
+ title: "[BR] "
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Before Submitting, be sure to**
11
+ - [ ] Update to the latest stable version.
12
+ - [ ] Read and follow the guides described in the [documentation](https://docs.regulaforensics.com?utm_source=github).
13
+ - [ ] Try to reproduce in our demo project.
14
+ - [ ] Search for your issue in the existing GitHub issues.
15
+
16
+ **Bug Description**
17
+ <!--A clear and concise description of what the bug is.-->
18
+
19
+ **Steps To Reproduce**
20
+ <!--
21
+ 1. Go to '...'
22
+ 2. Click on '....'
23
+ 3. Scroll down to '....'
24
+ 4. See error
25
+ -->
26
+
27
+ **Expected behavior**
28
+ <!--A clear and concise description of what you expected to happen.-->
29
+
30
+ **Screenshots**
31
+ <!--If applicable, add screenshots to help explain your issue.-->
32
+
33
+ **Environment:**
34
+ - Device: <!--[e.g. iPhone 12]-->
35
+ - OS: <!--[e.g. iOS]-->
36
+ - OS version: <!--[e.g. 10.0]-->
37
+
38
+ **Additional context**
39
+ <!--Add any other context about the problem here.-->
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Regula Help Center
4
+ url: https://support.regulaforensics.com/hc/requests/new?utm_source=github
5
+ about: Please submit any requests here
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest an idea for this product
4
+ title: "[FR] "
5
+ labels: enhancement
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ <!--A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]-->
12
+
13
+ **Describe the solution you'd like**
14
+ <!--A clear and concise description of what you want to happen.-->
15
+
16
+ **Describe alternatives you've considered**
17
+ <!--A clear and concise description of any alternative solutions or features you've considered.-->
18
+
19
+ **Additional context**
20
+ <!--Add any other context or screenshots about the feature request here.-->
package/example/README.md CHANGED
@@ -11,18 +11,15 @@ $ ionic cordova prepare
11
11
  4. Copy the `regula.license` file to the `example/src/assets` folder.
12
12
 
13
13
  5. Android:
14
- * Change the application ID to the one you have specified during the registration at [client.regulaforensics.com](https://client.regulaforensics.com).
15
14
  * Run `ionic cordova build android`, then`ionic cordova run android` inside `example` folder - this is just one way to run the app. You can also run it directly from within Android Studio.
16
15
 
17
16
  6. iOS:
18
- * Change the Bundle Identifier to the one you have specified during the registration at [client.regulaforensics.com](https://client.regulaforensics.com).
19
17
  * Run `ionic cordova build ios`, then `ionic cordova run ios` inside `example` folder - this is just one way to run the app. You can also run it directly from within Xcode.
20
18
 
21
19
 
22
20
  # Troubleshooting license issues
23
21
  If you have issues with license verification when running the application, please verify that next is true:
24
22
  1. The OS, which you use, is specified in the license (e.g., Android and/or iOS).
25
- 2. The application (Bundle) ID, which you use, is specified in the license.
26
23
  3. The license is valid (not expired).
27
24
  4. The date and time on the device, where you run the application, are valid.
28
25
  5. You use the latest release version of the Document Reader SDK.
@@ -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
- "@ionic-native/android-permissions": "^5.28.0",
23
- "@ionic-native/core": "^5.28.0",
24
- "@ionic-native/file": "^5.28.0",
25
- "@ionic-native/image-picker": "^5.28.0",
26
- "@ionic-native/splash-screen": "^5.28.0",
27
- "@ionic-native/status-bar": "^5.28.0",
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": "^6.3.0",
32
- "@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "^6.3.0",
33
- "@regulaforensics/ionic-native-document-reader": "^6.3.0",
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 '@ionic-native/splash-screen/ngx';
6
- import { StatusBar } from '@ionic-native/status-bar/ngx';
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 '@ionic-native/splash-screen/ngx';
5
- import { StatusBar } from '@ionic-native/status-bar/ngx';
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 '@ionic-native/splash-screen/ngx';
7
- import { StatusBar } from '@ionic-native/status-bar/ngx';
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 "@ionic-native/image-picker/ngx";
7
- import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
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 '@ionic-native/file'
3
- import { ImagePicker } from '@ionic-native/image-picker/ngx'
4
- import { AndroidPermissions } from '@ionic-native/android-permissions/ngx'
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(license).then(m => onInitialized()).catch(error1)
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 = isReadingRfid ? "none" : ""
109
- app.rfidUI.nativeElement.style.display = isReadingRfid ? "" : "none"
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 (isReadingRfid && (completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR))
126
+ if (isReadingRfidCustomUi && (completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR))
123
127
  hideRfidUI()
124
- if (isReadingRfid && completion.action === Enum.DocReaderAction.NOTIFICATION)
128
+ if (isReadingRfidCustomUi && completion.action === Enum.DocReaderAction.NOTIFICATION)
125
129
  updateRfidUI(completion.results.documentReaderNotification)
126
130
  if (completion.action === Enum.DocReaderAction.COMPLETE)
127
- if (isReadingRfid) {
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
- isReadingRfid = true
149
+ isReadingRfidCustomUi = true
142
150
  updateUI()
143
151
  }
144
152
 
145
153
  function hideRfidUI() {
146
154
  // show animation
147
155
  restartRfidUI()
148
- isReadingRfid = false
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
- doRfid = false
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) {