Skip to content

Commit

Permalink
Merge branch 'release/22'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard committed Jul 3, 2020
2 parents e7aeff3 + 927a6f3 commit 6ed5e84
Show file tree
Hide file tree
Showing 13 changed files with 724 additions and 527 deletions.
2 changes: 1 addition & 1 deletion example/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.anyline.examples.cordova" version="21.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="io.anyline.examples.cordova" version="22.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Anyline Cordova Example</name>
<preference name="deployment-target" value="10.0" />
<preference name="SwiftVersion" value="4.2" />
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anyline-cordova-example",
"version": "21.0.0",
"version": "22.0.0",
"description": "Cordova plugin for implementing Anyline",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions example/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ <h2>ID</h2>
<br />
<input type="button" value="Barcode PDF417" onclick="anyline.barcode.scan('pdf417')"
class="formButton" disabled=true/>
<br />
<input type="button" value="Universal Id" onclick="anyline.universalId.scan()"
class="formButton" disabled=true/>
<p>
</p>
<h2>Anyline OCR</h2>
Expand Down Expand Up @@ -172,6 +175,7 @@ <h2> Workflows </h2>
<script type="text/javascript" src="js/anyline.barcode.js"></script>
<script type="text/javascript" src="js/anyline.energy.js"></script>
<script type="text/javascript" src="js/anyline.mrz.js"></script>
<script type="text/javascript" src="js/anyline.universalId.js"></script>
<script type="text/javascript" src="js/anyline.nfc.js"></script>
<script type="text/javascript" src="js/anyline.ocr.js"></script>
<script type="text/javascript" src="js/anyline.drivingLicense.js"></script>
Expand Down
168 changes: 168 additions & 0 deletions example/www/js/anyline.universalId.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/*
* Anyline Cordova Plugin
* anyline.universalId.js
*
* Copyright (c) 2016 Anyline GmbH
*/

if (anyline === undefined) {
var anyline = {};
}
anyline.universalId = {
onResult: function (result) {
changeLoadingState(false);
//this is called for every universal Id scan result
//the result is a json-object containing all the scaned values and check-digits
console.log("Universal Id result: " + JSON.stringify(result));
var div = document.getElementById('results');

if (div.childElementCount >= 3) {
div.removeChild(div.childNodes[div.childElementCount - 1]);
}

var s = "<p>" + "<img src=\"" + result.imagePath + "\" width=\"100%\" height=\"auto\"/><br/>";
console.log("s 1: " + s);
console.log("result length: " + result.length);

// for (var i = 0; i < result.length; i++){
// var obj = result[i];
// for (var key in obj){
// var attrName = key;
// var attrValue = obj[key];
// console.log("name, value: " + attrName + " - " + attrValue);
// s = s.concat("<br/><b>" + attrName + ": </b>" + attrValue);
// console.log("s 2: " + s);
// }
// }


for (var key in result) {
if (result.hasOwnProperty(key)) {
var val = result[key];
if (key != "imagePath" && key != "fullImagePath" )
s = s.concat("<br/><b>" + key + ": </b>" + val);
console.log("-------------- key, value: " + key + " - " + val);
}
}



s = s.concat ("</p>");
console.log("s 3: " + s);
div.innerHTML = s;

document.getElementById("details_scan_modes").removeAttribute("open");
document.getElementById("details_results").setAttribute("open", "");
window.scrollTo(0, 0);
},

onError: function (error) {
changeLoadingState(false);
//called if an error occurred or the user canceled the scanning
if (error == "Canceled") {
//do stuff when user has canceled
// this can be used as an indicator that the user finished the scanning if canclelOnResult is false
console.log("Universal Id scanning canceled");
return;
}

alert(error);
},

anylineUniversalIdViewConfig: {
"camera" : {
"captureResolution" : "1080p",
"zoomGesture": true
},
"flash" : {
"mode": "manual",
"alignment": "bottom_right",
"imageOn": "flash_on",
"imageOff": "flash_off"
},
"viewPlugin" : {
"plugin":{
"id":"ID",
"idPlugin": {
"templateConfig": {
"drivingLicense": {
"surname": {"scanOption": 0, "minConfidence": 40},
"givenNames": {"scanOption": 0, "minConfidence": 40},
"dateOfBirth": {"scanOption": 0, "minConfidence": 50},
"placeOfBirth": {"scanOption": 0, "minConfidence": 50},
"dateOfIssue": {"scanOption": 0, "minConfidence": 50},
"dateOfExpiry": {"scanOption": 1, "minConfidence": 50},
"authority": {"scanOption": 1, "minConfidence": 30},
"documentNumber": {"scanOption": 0, "minConfidence": 40},
"categories": {"scanOption": 1, "minConfidence": 30},
"address": {"scanOption": 1}
},
"idFront": {
"surname": {"scanOption": 0, "minConfidence": 60},
"givenNames": {"scanOption": 0, "minConfidence": 60},
"dateOfBirth": {"scanOption": 0, "minConfidence": 60},
"placeOfBirth": {"scanOption": 0, "minConfidence": 60},
"dateOfExpiry": {"scanOption": 0, "minConfidence": 60},
"cardAccessNumber": {"scanOption": 0, "minConfidence": 60},
"documentNumber": {"scanOption": 0, "minConfidence": 60},
"nationality": {"scanOption": 0, "minConfidence": 60}
}
}

}
},
"cutoutConfig" : {
"style": "rect",
"maxWidthPercent": "90%",
"maxHeightPercent": "90%",
"alignment": "center",
"strokeWidth": 2,
"cornerRadius": 4,
"strokeColor": "FFFFFF",
"outerColor": "000000",
"outerAlpha": 0.3,
"ratioFromSize" : {
"width": 50,
"height": 31
},
"cropPadding": {
"x": -30,
"y": -90
},
"cropOffset": {
"x": 0,
"y": 90
},
"feedbackStrokeColor": "0099FF"
},
"scanFeedback" : {
"style": "contour_rect",
"visualFeedbackRedrawTimeout": 100,
"strokeColor": "0099FF",
"fillColor" : "220099FF",
"beepOnResult": true,
"vibrateOnResult": true,
"strokeWidth": 2
},
"cancelOnResult" : true
}
},

scan: function () {
if (localStorage.getItem("hasStartedAnyline") === 'true') {
return;
}
changeLoadingState(true);
// start the UniversalId scanning
// pass the success and error callbacks, as well as the license key and the config to the plugin
// see http://documentation.anyline.io/#anyline-config for config details
// and http://documentation.anyline.io/#universalId for module details

var licenseKey = "eyAiYW5kcm9pZElkZW50aWZpZXIiOiBbICJpby5hbnlsaW5lLmV4YW1wbGVzLmNvc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Mk5acUNKSjhPLzBUT2trNmc9PQo=";


cordova.exec(this.onResult, this.onError, "AnylineSDK", "scan", [licenseKey, this.anylineUniversalIdViewConfig]);
}
};


2 changes: 1 addition & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "io-anyline-cordova",
"version": "21.0.0",
"version": "22.0.0",
"description": "The cordova plugin for the Anyline SDK",
"cordova": {
"id": "io-anyline-cordova",
Expand Down
4 changes: 2 additions & 2 deletions plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="io-anyline-cordova"
version="21.0.0">
version="22.0.0">

<name>AnylineSDK</name>

Expand Down Expand Up @@ -44,7 +44,7 @@
<!-- <resource-file src="src/ios/anyline_sdk/AnylineResources.bundle"/>-->

<!-- Anyline Framework & Resource Bundle CocoaPods -->
<framework src="Anyline" type="podspec" swift-version="4.2" spec="~> 21"/>
<framework src="Anyline" type="podspec" swift-version="4.2" spec="~> 22"/>

<!-- <podspec>
<config>
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/android/anyline.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories{
dependencies {
implementation 'com.google.firebase:firebase-ml-vision:19.0.2'
implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
implementation 'io.anyline:anylinesdk:21-NoDocUI@aar'
implementation 'io.anyline:anylinesdk:22-NoDocUI@aar'
// implementation (name: 'anylinesdk-release-16', ext: 'aar')
}

Expand Down
Loading

0 comments on commit 6ed5e84

Please sign in to comment.