@regulaforensics/cordova-plugin-document-reader-api 6.8.0 → 6.9.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.
@@ -16,16 +16,9 @@
16
16
  <allow-intent href="mailto:*" />
17
17
  <allow-intent href="geo:*" />
18
18
  <platform name="android">
19
- <preference name="GradlePluginKotlinEnabled" value="true" />
20
- <preference name="GradlePluginKotlinCodeStyle" value="official" />
21
- <preference name="GradlePluginKotlinVersion" value="1.7.10" />
22
19
  <preference name="android-minSdkVersion" value="23" />
23
- <preference name="android-targetSdkVersion" value="33" />
24
- <preference name="AndroidXEnabled" value="true" />
20
+ <preference name="android-targetSdkVersion" value="34" />
25
21
  <allow-intent href="market:*" />
26
- <config-file parent="/manifest/application" target="AndroidManifest.xml">
27
- <activity android:label="@string/multi_app_name" android:name="com.synconset.MultiImageChooserActivity" android:theme="@style/Theme.AppCompat.Light" />
28
- </config-file>
29
22
  <config-file parent="/*" target="AndroidManifest.xml">
30
23
  <uses-permission android:name="android.permission.NFC" />
31
24
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@@ -13,16 +13,15 @@
13
13
  "author": "Regula Forensics Inc.",
14
14
  "license": "commercial",
15
15
  "dependencies": {
16
- "cordova-android": "10.1.2",
17
- "cordova-ios": "^6.3.0",
18
- "cordova-plugin-add-swift-support": "^2.0.2",
19
- "@regulaforensics/cordova-plugin-document-reader-api": "6.8.0",
20
- "@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "6.8.0",
21
- "cordova-plugin-file": "^7.0.0",
22
- "cordova-plugin-telerik-imagepicker": "^2.3.6",
23
- "cordova-plugin-android-permissions": "1.1.5",
16
+ "@regulaforensics/cordova-plugin-document-reader-api": "6.9.0",
17
+ "@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "6.9.0",
18
+ "cordova-android": "12.0.0",
19
+ "cordova-ios": "7.0.0",
20
+ "cordova-plugin-add-swift-support": "2.0.2",
24
21
  "cordova-plugin-advanced-http": "3.3.1",
25
- "jetifier": "^2.0.0"
22
+ "cordova-plugin-android-permissions": "1.1.5",
23
+ "cordova-plugin-file": "8.0.0",
24
+ "jetifier": "2.0.0"
26
25
  },
27
26
  "cordova": {
28
27
  "plugins": {
@@ -32,9 +31,6 @@
32
31
  },
33
32
  "@regulaforensics/cordova-plugin-document-reader-core-fullrfid": {},
34
33
  "cordova-plugin-file": {},
35
- "cordova-plugin-telerik-imagepicker": {
36
- "PHOTO_LIBRARY_USAGE_DESCRIPTION": " "
37
- },
38
34
  "cordova-plugin-android-permissions": {},
39
35
  "cordova-plugin-advanced-http": {}
40
36
  },
@@ -14,8 +14,11 @@ var app = {
14
14
  var DocumentReaderResults = DocumentReaderPlugin.DocumentReaderResults
15
15
  var DocumentReaderScenario = DocumentReaderPlugin.DocumentReaderScenario
16
16
  var DocumentReaderCompletion = DocumentReaderPlugin.DocumentReaderCompletion
17
+ var ScannerConfig = DocumentReaderPlugin.ScannerConfig
18
+ var RecognizeConfig = DocumentReaderPlugin.RecognizeConfig
17
19
  var Enum = DocumentReaderPlugin.Enum
18
20
 
21
+ var selectedScenario = "Mrz"
19
22
  var doRfid = false
20
23
  var encryption = false
21
24
  const ENCRYPTED_RESULT_SERVICE = "https://api.regulaforensics.com/api/process"
@@ -41,7 +44,7 @@ var app = {
41
44
  input.value = DocumentReaderScenario.fromJson(typeof scenarios[index] === "string" ? JSON.parse(scenarios[index]) : scenarios[index]).name
42
45
  if (index == 0)
43
46
  input.checked = true
44
- input.onclick = function () { DocumentReader.setConfig({ processParams: { scenario: this.value } }, function (m) { }, function (e) { }) }
47
+ input.onclick = function () { selectedScenario = this.value }
45
48
  input.style.display = "inline-block"
46
49
  document.getElementById("scenariosRadioGroup").appendChild(input)
47
50
  var label = document.createElement("span")
@@ -68,7 +71,9 @@ var app = {
68
71
  }
69
72
 
70
73
  function scan() {
71
- DocumentReader.showScanner(function (m) {
74
+ var config = new ScannerConfig()
75
+ config.scenario = selectedScenario
76
+ DocumentReader.scan(config, function (m) {
72
77
  handleCompletion(DocumentReaderCompletion.fromJson(JSON.parse(m)))
73
78
  }, function (e) { })
74
79
  }
@@ -95,14 +100,20 @@ var app = {
95
100
  }
96
101
 
97
102
  function recognize() {
98
- window.imagePicker.getPictures(function (images) {
99
- document.getElementById("status").innerHTML = "processing image......"
100
- document.getElementById("status").style.backgroundColor = "grey"
101
- DocumentReader.recognizeImages(images, function (m) { handleCompletion(DocumentReaderCompletion.fromJson(JSON.parse(m))) }, function (e) { })
102
- }, function (e) { }, { maximumImagesCount: 10, outputType: window.imagePicker.OutputType.BASE64_STRING })
103
+ // window.imagePicker.getPictures(function (images) {
104
+ // document.getElementById("status").innerHTML = "processing image......"
105
+ // document.getElementById("status").style.backgroundColor = "grey"
106
+ // var config = new RecognizeConfig()
107
+ // config.scenario = selectedScenario
108
+ // config.images = images
109
+ // DocumentReader.recognize(config, function (m) {
110
+ // handleCompletion(DocumentReaderCompletion.fromJson(JSON.parse(m)))
111
+ // }, function (e) { })
112
+ // }, function (e) { }, { maximumImagesCount: 10, outputType: window.imagePicker.OutputType.BASE64_STRING })
103
113
  }
104
114
 
105
115
  function handleCompletion(completion) {
116
+ console.log("DocReaderAction: " + completion.action)
106
117
  if (isReadingRfidCustomUi && (completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR))
107
118
  hideRfidUI()
108
119
  if (isReadingRfidCustomUi && completion.action === Enum.DocReaderAction.NOTIFICATION)
@@ -153,7 +164,7 @@ var app = {
153
164
 
154
165
  function updateRfidUI(results) {
155
166
  if (results.value == null) return
156
- if (results.code === Enum.eRFID_NotificationCodes.RFID_NOTIFICATION_PCSC_READING_DATAGROUP) {
167
+ if (results.notificationCode === Enum.eRFID_NotificationCodes.RFID_NOTIFICATION_PCSC_READING_DATAGROUP) {
157
168
  rfidDescription = Enum.eRFID_DataFile_Type.getTranslation(results.dataFileType)
158
169
  document.getElementById("rfidDescription").innerHTML = rfidDescription
159
170
  }
@@ -161,10 +172,10 @@ var app = {
161
172
  document.getElementById("rfidUIHeader").innerHTML = rfidUIHeader
162
173
  rfidUIHeaderColor = "black"
163
174
  document.getElementById("rfidUIHeader").style.color = rfidUIHeaderColor
164
- rfidProgress = results.value
175
+ rfidProgress = results.progress
165
176
  document.getElementById("rfidProgress").value = rfidProgress
166
177
  if (window.cordova.platformId === 'ios')
167
- DocumentReader.setRfidSessionStatus(rfidDescription + "\n" + results.value + "%", function (e) { }, function (e) { })
178
+ DocumentReader.setRfidSessionStatus(rfidDescription + "\n" + results.progress + "%", function (e) { }, function (e) { })
168
179
  }
169
180
 
170
181
  function customRFID() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/cordova-plugin-document-reader-api",
3
- "version": "6.8.0",
3
+ "version": "6.9.0",
4
4
  "description": "Cordova plugin for reading and validation of identification documents (API framework)",
5
5
  "cordova": {
6
6
  "id": "@regulaforensics/cordova-plugin-document-reader-api",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="cordova-plugin-document-reader-api" version="6.8.0"
2
+ <plugin id="cordova-plugin-document-reader-api" version="6.9.0"
3
3
  xmlns="http://apache.org/cordova/ns/plugins/1.0">
4
4
  <name>DocumentReaderApi</name>
5
5
  <description>Cordova plugin Document reader api</description>
@@ -26,7 +26,7 @@
26
26
  <config>
27
27
  </config>
28
28
  <pods>
29
- <pod name="DocumentReader" spec="6.8.2981" />
29
+ <pod name="DocumentReader" spec="6.9.3102" />
30
30
  </pods>
31
31
  </podspec>
32
32
  </platform>
@@ -69,8 +69,8 @@ class BluetoothUtil {
69
69
  }
70
70
 
71
71
  private fun deniedBluetoothPermission(
72
- activity: Activity,
73
- permission: String
72
+ activity: Activity,
73
+ permission: String
74
74
  ): Array<String> {
75
75
  if (checkSelfPermission(activity, permission) != PERMISSION_GRANTED)
76
76
  return arrayOf(permission)
@@ -78,10 +78,10 @@ class BluetoothUtil {
78
78
  }
79
79
 
80
80
  fun startBluetoothService(
81
- activity: Activity,
82
- onConnected: (Boolean) -> Unit,
83
- onDisconnected: () -> Unit,
84
- onReady: () -> Unit,
81
+ activity: Activity,
82
+ onConnected: (Boolean) -> Unit,
83
+ onDisconnected: () -> Unit,
84
+ onReady: () -> Unit
85
85
  ) {
86
86
  val bleIntent = Intent(activity, RegulaBleService::class.java)
87
87
  activity.startService(bleIntent)