Skip to content

Commit

Permalink
6.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Feb 14, 2023
1 parent 829e0b3 commit 409f8d9
Show file tree
Hide file tree
Showing 13 changed files with 477 additions and 239 deletions.
5 changes: 4 additions & 1 deletion example/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
<preference name="GradlePluginKotlinCodeStyle" value="official" />
<preference name="GradlePluginKotlinVersion" value="1.7.10" />
<preference name="android-minSdkVersion" value="21" />
<preference name="android-targetSdkVersion" value="33" />
<preference name="android-targetSdkVersion" value="31" />
<preference name="AndroidXEnabled" value="true" />
<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
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"cordova-android": "^10.1.1",
"cordova-ios": "^6.2.0",
"cordova-plugin-add-swift-support": "^2.0.2",
"@regulaforensics/cordova-plugin-document-reader-api": "6.7.0",
"@regulaforensics/cordova-plugin-document-reader-api": "6.7.1",
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "6.7.0",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-image-picker": "^1.1.3",
"cordova-plugin-telerik-imagepicker": "^2.3.5",
"cordova-plugin-android-permissions": "1.1.0",
"cordova-plugin-advanced-http": "3.2.1",
"jetifier": "^2.0.0"
Expand All @@ -32,7 +32,7 @@
},
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": {},
"cordova-plugin-file": {},
"cordova-plugin-image-picker": {
"cordova-plugin-telerik-imagepicker": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": " "
},
"cordova-plugin-whitelist": {},
Expand Down
39 changes: 14 additions & 25 deletions example/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,11 @@ var app = {
}

function recognize() {
window.imagePicker.getPictures(function (results) {
if (results.length > 0) {
clearResults()
document.getElementById("status").innerHTML = "copying image......"
document.getElementById("status").style.backgroundColor = "grey"
}
var images = []
for (var index in results)
readFile(results[index], function (base64) {
document.getElementById("status").innerHTML = "processing image......"
document.getElementById("status").style.backgroundColor = "grey"
images.push(base64)
if (images.length === results.length)
DocumentReader.recognizeImages(images, function (m) { handleCompletion(DocumentReader.DocumentReaderCompletion.fromJson(JSON.parse(m))) }, function (e) { })
})
}, function (e) { }, { maximumImagesCount: 10 })
window.imagePicker.getPictures(function (images) {
document.getElementById("status").innerHTML = "processing image......"
document.getElementById("status").style.backgroundColor = "grey"
DocumentReader.recognizeImages(images, function (m) { handleCompletion(DocumentReader.DocumentReaderCompletion.fromJson(JSON.parse(m))) }, function (e) { })
}, function (e) { }, { maximumImagesCount: 10, outputType: window.imagePicker.OutputType.BASE64_STRING })
}

function handleCompletion(completion) {
Expand All @@ -125,7 +114,7 @@ var app = {
handleResults(completion.results)
if (completion.action === Enum.DocReaderAction.TIMEOUT)
handleResults(completion.results)
if(completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR)
if (completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR)
isReadingRfid = false
}

Expand Down Expand Up @@ -161,7 +150,7 @@ var app = {

function updateRfidUI(results) {
if (results.code === Enum.eRFID_NotificationCodes.RFID_NOTIFICATION_PCSC_READING_DATAGROUP) {
rfidDescription = Enum.eRFID_DataFile_Type.getTranslation(results.number)
rfidDescription = Enum.eRFID_DataFile_Type.getTranslation(results.dataFileType)
document.getElementById("rfidDescription").innerHTML = rfidDescription
}
rfidUIHeader = "Reading RFID"
Expand Down Expand Up @@ -242,21 +231,21 @@ var app = {
}

function displayResults(results) {
if(results == null) return
if (results == null) return

DocumentReader.getTextFieldValueByType(results, Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, function (value) {
DocumentReader.textFieldValueByType(results, Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, function (value) {
document.getElementById("status").style.backgroundColor = "green"
document.getElementById("status").innerHTML = value
this.setState({ fullName: value })
this.setState({ fullName: value })
}, function (error) { console.log(error) })

DocumentReader.getGraphicFieldImageByType(results, Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, function (value) {
if(value != null)
DocumentReader.graphicFieldImageByType(results, Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, function (value) {
if (value != null)
document.getElementById("documentImage").src = "data:image/png;base64," + value
}, function (error) { console.log(error) })

DocumentReader.getGraphicFieldImageByType(results, Enum.eGraphicFieldType.GF_PORTRAIT, function (value) {
if(value != null)
DocumentReader.graphicFieldImageByType(results, Enum.eGraphicFieldType.GF_PORTRAIT, function (value) {
if (value != null)
document.getElementById("portraitImage").src = "data:image/png;base64," + value
}, function (error) { console.log(error) })
}
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.7.0",
"version": "6.7.1",
"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.7.0"
<plugin id="cordova-plugin-document-reader-api" version="6.7.1"
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.7.2848" />
<pod name="DocumentReader" spec="6.7.2848" />
</pods>
</podspec>
</platform>
Expand Down
Loading

0 comments on commit 409f8d9

Please sign in to comment.