Skip to content

Commit

Permalink
Release/43.0.1 (#162)
Browse files Browse the repository at this point in the history
* Improve Error Surfacing

* Add gradle wrappers

* Update version number
  • Loading branch information
igor-graca authored Feb 28, 2023
1 parent edda6c0 commit e3c52b3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 32 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ The plugin enables the connection to the SDK via React-Native.

## Getting Started

Check out our getting-started section here: https://documentation-preview.anyline.com/react-native-plugin-component/43.0.0/getting-started.html
Check out our getting-started section here: https://documentation-preview.anyline.com/react-native-plugin-component/43.0.1/getting-started.html

## Documentation

Check out our developer guide here: https://documentation-preview.anyline.com/react-native-plugin-component/43.0.0/index.html
Check out our developer guide here: https://documentation-preview.anyline.com/react-native-plugin-component/43.0.1/index.html

## License

Expand Down
Binary file not shown.
Binary file added plugin/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public void update(
}
} catch (JSONException e) {
e.printStackTrace();
returnError(e.getMessage());
}
}

Expand All @@ -103,6 +104,7 @@ public void initSdk(String license) {
AnylineSdk.init(license, reactContext);
} catch (LicenseException e) {
e.printStackTrace();
returnError(e.getMessage());
}
}

Expand Down Expand Up @@ -160,36 +162,34 @@ private void routeScanMode(String scanMode) {
private void scanAnyline4() {
try {
configObject = new JSONObject(this.config);
// JSONObject options = configObject;
if (configObject != null) {
scan();
} else {
returnError("No ViewPlugin in config. Please check your configuration.");
}
} catch (LicenseException e) {
e.printStackTrace();
returnError("LICENSE ERROR: " + e.getMessage());
} catch (JSONException e) {
e.printStackTrace();
returnError("JSON ERROR: " + e.getMessage());
}
}

private void scan() {
private void scan() throws LicenseException, JSONException {

Intent intent = new Intent(getCurrentActivity(), ScanActivity.class);

try {
configObject = new JSONObject(this.config);

license = configObject.get("license").toString();
JSONObject optionsJSONObject = configObject.optJSONObject("options");
configObject = new JSONObject(this.config);

if (optionsJSONObject != null) {
intent.putExtra(
EXTRA_ENABLE_BARCODE_SCANNING,
optionsJSONObject.optBoolean("nativeBarcodeEnabled", false)
);
}
license = configObject.get("license").toString();
JSONObject optionsJSONObject = configObject.optJSONObject("options");

} catch (JSONException e) {
returnError("JSON ERROR: " + e.getMessage());
if (optionsJSONObject != null) {
intent.putExtra(
EXTRA_ENABLE_BARCODE_SCANNING,
optionsJSONObject.optBoolean("nativeBarcodeEnabled", false)
);
}

intent.putExtra(EXTRA_LICENSE_KEY, license);
Expand All @@ -198,13 +198,7 @@ private void scan() {
ResultReporter.setListener(this);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

try {
AnylineSdk.init(configObject.getString("license"), reactContext);
} catch (LicenseException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
AnylineSdk.init(configObject.getString("license"), reactContext);
reactContext.startActivityForResult(intent, 1111, intent.getExtras());
}

Expand Down
16 changes: 8 additions & 8 deletions plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"_from": "anyline-ocr-react-native-module@^43.0.0",
"_id": "anyline-ocr-react-native-module@^43.0.0",
"_from": "anyline-ocr-react-native-module@^43.0.1",
"_id": "anyline-ocr-react-native-module@^43.0.1",
"_inBundle": false,
"_integrity": "sha512-BGi9zNkSsoxXywDBIqzgBRvKUBniQOJHDKBrozZubKthZNRBAj8Ry5tW0Me0yLXt/fauME//hbC0wsenfPJZqw==",
"_location": "/anyline-ocr-react-native-module",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "anyline-ocr-react-native-module@^43.0.0",
"raw": "anyline-ocr-react-native-module@^43.0.1",
"name": "anyline-ocr-react-native-module",
"escapedName": "anyline-ocr-react-native-module",
"rawSpec": "^43.0.0",
"rawSpec": "^43.0.1",
"saveSpec": null,
"fetchSpec": "^43.0.0"
"fetchSpec": "^43.0.1"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-43.0.0.tgz",
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-43.0.1.tgz",
"_shasum": "bacbcd260cc662244f59393ed81a6edba009b52c",
"_spec": "anyline-ocr-react-native-module@^43.0.0",
"_spec": "anyline-ocr-react-native-module@^43.0.1",
"_where": "/Users/amiransari/Projects/anyline-ocr-react-native-module1/example/RNExampleApp",
"bugs": {
"url": "https://github.com/Anyline/anyline-ocr-react-native-module/issues"
Expand All @@ -47,5 +47,5 @@
"type": "git",
"url": "git+https://github.com/Anyline/anyline-ocr-react-native-module.git"
},
"version": "43.0.0"
"version": "43.0.1"
}

0 comments on commit e3c52b3

Please sign in to comment.