Skip to content

Commit

Permalink
Release 54.2.2 (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitlokhandeanyline authored Nov 4, 2024
1 parent fc38bab commit 1d81b4c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 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="com.anyline.examples.cordova" version="54.2.1" ios-CFBundleVersion="1"
<widget id="com.anyline.examples.cordova" version="54.2.2" ios-CFBundleVersion="1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Anyline Cordova Example</name>
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": "54.2.1",
"version": "54.2.2",
"description": "Cordova plugin for implementing Anyline",
"main": "index.js",
"scripts": {
Expand Down
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": "54.2.1",
"version": "54.2.2",
"description": "The cordova plugin for the Anyline SDK",
"cordova": {
"id": "io-anyline-cordova",
Expand Down
2 changes: 1 addition & 1 deletion plugin/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android" id="io-anyline-cordova" version="54.2.1">
xmlns:android="http://schemas.android.com/apk/res/android" id="io-anyline-cordova" version="54.2.2">

<name>AnylineSDK</name>

Expand Down
31 changes: 31 additions & 0 deletions plugin/src/android/io/anyline/cordova/AnylinePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private void onError(String errorMessage) {

private void startScanning(String action, JSONArray args) {
if (action.equals("scan")) {
deleteAllPreviousScanResultImages(cordova.getContext());
scan(ScanActivity.class, REQUEST_ANYLINE_4, args);
} else {
this.callbackContext.error(getString("error_unkown_scan_mode") + " " + action);
Expand Down Expand Up @@ -203,4 +204,34 @@ private void getPluginVersion() {
private void getSDKVersion() {
onResult(at.nineyards.anyline.BuildConfig.VERSION_NAME, true);
}

/**
* This function removes all previous scan result images from disk, either from external
* or internal files dir, e.g.:
* /sdcard/Android/[applicationId]/files/results/image1729849635965
*/
private void deleteAllPreviousScanResultImages(Context context) {
String imagePath = "";
if (context.getExternalFilesDir(null) != null) {
imagePath = context
.getExternalFilesDir(null)
.toString() + "/results/";

} else if (context.getFilesDir() != null) {
imagePath = context
.getFilesDir()
.toString() + "/results/";
}

File resultFolder = new File(imagePath);
File[] files = resultFolder.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().startsWith("image")) {
file.delete();
}
}
}
}

}

0 comments on commit 1d81b4c

Please sign in to comment.