Skip to content

Commit

Permalink
6.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Sep 8, 2023
1 parent 4c9c7bf commit d89e4b9
Show file tree
Hide file tree
Showing 17 changed files with 1,171 additions and 3,600 deletions.
9 changes: 1 addition & 8 deletions example/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<preference name="GradlePluginKotlinEnabled" value="true" />
<preference name="GradlePluginKotlinCodeStyle" value="official" />
<preference name="GradlePluginKotlinVersion" value="1.7.10" />
<preference name="android-minSdkVersion" value="23" />
<preference name="android-targetSdkVersion" value="33" />
<preference name="AndroidXEnabled" value="true" />
<preference name="android-targetSdkVersion" value="34" />
<allow-intent href="market:*" />
<config-file parent="/manifest/application" target="AndroidManifest.xml">
<activity android:label="@string/multi_app_name" android:name="com.synconset.MultiImageChooserActivity" android:theme="@style/Theme.AppCompat.Light" />
</config-file>
<config-file parent="/*" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down
20 changes: 8 additions & 12 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
"author": "Regula Forensics Inc.",
"license": "commercial",
"dependencies": {
"cordova-android": "10.1.2",
"cordova-ios": "^6.3.0",
"cordova-plugin-add-swift-support": "^2.0.2",
"@regulaforensics/cordova-plugin-document-reader-api": "6.8.1",
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "6.8.1",
"cordova-plugin-file": "^7.0.0",
"cordova-plugin-telerik-imagepicker": "^2.3.6",
"cordova-plugin-android-permissions": "1.1.5",
"@regulaforensics/cordova-plugin-document-reader-api": "6.9.0",
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "6.9.0",
"cordova-android": "12.0.0",
"cordova-ios": "7.0.0",
"cordova-plugin-add-swift-support": "2.0.2",
"cordova-plugin-advanced-http": "3.3.1",
"jetifier": "^2.0.0"
"cordova-plugin-android-permissions": "1.1.5",
"cordova-plugin-file": "8.0.0",
"jetifier": "2.0.0"
},
"cordova": {
"plugins": {
Expand All @@ -32,9 +31,6 @@
},
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": {},
"cordova-plugin-file": {},
"cordova-plugin-telerik-imagepicker": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": " "
},
"cordova-plugin-android-permissions": {},
"cordova-plugin-advanced-http": {}
},
Expand Down
31 changes: 21 additions & 10 deletions example/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ var app = {
var DocumentReaderResults = DocumentReaderPlugin.DocumentReaderResults
var DocumentReaderScenario = DocumentReaderPlugin.DocumentReaderScenario
var DocumentReaderCompletion = DocumentReaderPlugin.DocumentReaderCompletion
var ScannerConfig = DocumentReaderPlugin.ScannerConfig
var RecognizeConfig = DocumentReaderPlugin.RecognizeConfig
var Enum = DocumentReaderPlugin.Enum

var selectedScenario = "Mrz"
var doRfid = false
var encryption = false
const ENCRYPTED_RESULT_SERVICE = "https://api.regulaforensics.com/api/process"
Expand All @@ -41,7 +44,7 @@ var app = {
input.value = DocumentReaderScenario.fromJson(typeof scenarios[index] === "string" ? JSON.parse(scenarios[index]) : scenarios[index]).name
if (index == 0)
input.checked = true
input.onclick = function () { DocumentReader.setConfig({ processParams: { scenario: this.value } }, function (m) { }, function (e) { }) }
input.onclick = function () { selectedScenario = this.value }
input.style.display = "inline-block"
document.getElementById("scenariosRadioGroup").appendChild(input)
var label = document.createElement("span")
Expand All @@ -68,7 +71,9 @@ var app = {
}

function scan() {
DocumentReader.showScanner(function (m) {
var config = new ScannerConfig()
config.scenario = selectedScenario
DocumentReader.scan(config, function (m) {
handleCompletion(DocumentReaderCompletion.fromJson(JSON.parse(m)))
}, function (e) { })
}
Expand All @@ -95,14 +100,20 @@ var app = {
}

function recognize() {
window.imagePicker.getPictures(function (images) {
document.getElementById("status").innerHTML = "processing image......"
document.getElementById("status").style.backgroundColor = "grey"
DocumentReader.recognizeImages(images, function (m) { handleCompletion(DocumentReaderCompletion.fromJson(JSON.parse(m))) }, function (e) { })
}, function (e) { }, { maximumImagesCount: 10, outputType: window.imagePicker.OutputType.BASE64_STRING })
// window.imagePicker.getPictures(function (images) {
// document.getElementById("status").innerHTML = "processing image......"
// document.getElementById("status").style.backgroundColor = "grey"
// var config = new RecognizeConfig()
// config.scenario = selectedScenario
// config.images = images
// DocumentReader.recognize(config, function (m) {
// handleCompletion(DocumentReaderCompletion.fromJson(JSON.parse(m)))
// }, function (e) { })
// }, function (e) { }, { maximumImagesCount: 10, outputType: window.imagePicker.OutputType.BASE64_STRING })
}

function handleCompletion(completion) {
console.log("DocReaderAction: " + completion.action)
if (isReadingRfidCustomUi && (completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR))
hideRfidUI()
if (isReadingRfidCustomUi && completion.action === Enum.DocReaderAction.NOTIFICATION)
Expand Down Expand Up @@ -153,18 +164,18 @@ var app = {

function updateRfidUI(results) {
if (results.value == null) return
if (results.code === Enum.eRFID_NotificationCodes.RFID_NOTIFICATION_PCSC_READING_DATAGROUP) {
if (results.notificationCode === Enum.eRFID_NotificationCodes.RFID_NOTIFICATION_PCSC_READING_DATAGROUP) {
rfidDescription = Enum.eRFID_DataFile_Type.getTranslation(results.dataFileType)
document.getElementById("rfidDescription").innerHTML = rfidDescription
}
rfidUIHeader = "Reading RFID"
document.getElementById("rfidUIHeader").innerHTML = rfidUIHeader
rfidUIHeaderColor = "black"
document.getElementById("rfidUIHeader").style.color = rfidUIHeaderColor
rfidProgress = results.value
rfidProgress = results.progress
document.getElementById("rfidProgress").value = rfidProgress
if (window.cordova.platformId === 'ios')
DocumentReader.setRfidSessionStatus(rfidDescription + "\n" + results.value + "%", function (e) { }, function (e) { })
DocumentReader.setRfidSessionStatus(rfidDescription + "\n" + results.progress + "%", function (e) { }, function (e) { })
}

function customRFID() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@regulaforensics/cordova-plugin-document-reader-api",
"version": "6.8.1",
"version": "6.9.0",
"description": "Cordova plugin for reading and validation of identification documents (API framework)",
"cordova": {
"id": "@regulaforensics/cordova-plugin-document-reader-api",
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-document-reader-api" version="6.8.1"
<plugin id="cordova-plugin-document-reader-api" version="6.9.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0">
<name>DocumentReaderApi</name>
<description>Cordova plugin Document reader api</description>
Expand All @@ -26,7 +26,7 @@
<config>
</config>
<pods>
<pod name="DocumentReader" spec="6.8.2981" />
<pod name="DocumentReader" spec="6.9.3102" />
</pods>
</podspec>
</platform>
Expand Down
12 changes: 6 additions & 6 deletions src/android/BluetoothUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ class BluetoothUtil {
}

private fun deniedBluetoothPermission(
activity: Activity,
permission: String
activity: Activity,
permission: String
): Array<String> {
if (checkSelfPermission(activity, permission) != PERMISSION_GRANTED)
return arrayOf(permission)
return arrayOf()
}

fun startBluetoothService(
activity: Activity,
onConnected: (Boolean) -> Unit,
onDisconnected: () -> Unit,
onReady: () -> Unit,
activity: Activity,
onConnected: (Boolean) -> Unit,
onDisconnected: () -> Unit,
onReady: () -> Unit
) {
val bleIntent = Intent(activity, RegulaBleService::class.java)
activity.startService(bleIntent)
Expand Down
Loading

0 comments on commit d89e4b9

Please sign in to comment.