Skip to content

Commit e3c52b3

Browse files
authored
Release/43.0.1 (#162)
* Improve Error Surfacing * Add gradle wrappers * Update version number
1 parent edda6c0 commit e3c52b3

File tree

5 files changed

+26
-32
lines changed

5 files changed

+26
-32
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ The plugin enables the connection to the SDK via React-Native.
1919

2020
## Getting Started
2121

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

2424
## Documentation
2525

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

2828
## License
2929

Binary file not shown.
60.1 KB
Binary file not shown.

plugin/android/src/main/java/com/anyline/reactnative/AnylineSDKPlugin.java

+16-22
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public void update(
9494
}
9595
} catch (JSONException e) {
9696
e.printStackTrace();
97+
returnError(e.getMessage());
9798
}
9899
}
99100

@@ -103,6 +104,7 @@ public void initSdk(String license) {
103104
AnylineSdk.init(license, reactContext);
104105
} catch (LicenseException e) {
105106
e.printStackTrace();
107+
returnError(e.getMessage());
106108
}
107109
}
108110

@@ -160,36 +162,34 @@ private void routeScanMode(String scanMode) {
160162
private void scanAnyline4() {
161163
try {
162164
configObject = new JSONObject(this.config);
163-
// JSONObject options = configObject;
164165
if (configObject != null) {
165166
scan();
166167
} else {
167168
returnError("No ViewPlugin in config. Please check your configuration.");
168169
}
170+
} catch (LicenseException e) {
171+
e.printStackTrace();
172+
returnError("LICENSE ERROR: " + e.getMessage());
169173
} catch (JSONException e) {
170174
e.printStackTrace();
175+
returnError("JSON ERROR: " + e.getMessage());
171176
}
172177
}
173178

174-
private void scan() {
179+
private void scan() throws LicenseException, JSONException {
175180

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

178-
try {
179-
configObject = new JSONObject(this.config);
180-
181-
license = configObject.get("license").toString();
182-
JSONObject optionsJSONObject = configObject.optJSONObject("options");
183+
configObject = new JSONObject(this.config);
183184

184-
if (optionsJSONObject != null) {
185-
intent.putExtra(
186-
EXTRA_ENABLE_BARCODE_SCANNING,
187-
optionsJSONObject.optBoolean("nativeBarcodeEnabled", false)
188-
);
189-
}
185+
license = configObject.get("license").toString();
186+
JSONObject optionsJSONObject = configObject.optJSONObject("options");
190187

191-
} catch (JSONException e) {
192-
returnError("JSON ERROR: " + e.getMessage());
188+
if (optionsJSONObject != null) {
189+
intent.putExtra(
190+
EXTRA_ENABLE_BARCODE_SCANNING,
191+
optionsJSONObject.optBoolean("nativeBarcodeEnabled", false)
192+
);
193193
}
194194

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

201-
try {
202-
AnylineSdk.init(configObject.getString("license"), reactContext);
203-
} catch (LicenseException e) {
204-
e.printStackTrace();
205-
} catch (JSONException e) {
206-
e.printStackTrace();
207-
}
201+
AnylineSdk.init(configObject.getString("license"), reactContext);
208202
reactContext.startActivityForResult(intent, 1111, intent.getExtras());
209203
}
210204

plugin/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"_from": "anyline-ocr-react-native-module@^43.0.0",
3-
"_id": "anyline-ocr-react-native-module@^43.0.0",
2+
"_from": "anyline-ocr-react-native-module@^43.0.1",
3+
"_id": "anyline-ocr-react-native-module@^43.0.1",
44
"_inBundle": false,
55
"_integrity": "sha512-BGi9zNkSsoxXywDBIqzgBRvKUBniQOJHDKBrozZubKthZNRBAj8Ry5tW0Me0yLXt/fauME//hbC0wsenfPJZqw==",
66
"_location": "/anyline-ocr-react-native-module",
77
"_phantomChildren": {},
88
"_requested": {
99
"type": "range",
1010
"registry": true,
11-
"raw": "anyline-ocr-react-native-module@^43.0.0",
11+
"raw": "anyline-ocr-react-native-module@^43.0.1",
1212
"name": "anyline-ocr-react-native-module",
1313
"escapedName": "anyline-ocr-react-native-module",
14-
"rawSpec": "^43.0.0",
14+
"rawSpec": "^43.0.1",
1515
"saveSpec": null,
16-
"fetchSpec": "^43.0.0"
16+
"fetchSpec": "^43.0.1"
1717
},
1818
"_requiredBy": [
1919
"/"
2020
],
21-
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-43.0.0.tgz",
21+
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-43.0.1.tgz",
2222
"_shasum": "bacbcd260cc662244f59393ed81a6edba009b52c",
23-
"_spec": "anyline-ocr-react-native-module@^43.0.0",
23+
"_spec": "anyline-ocr-react-native-module@^43.0.1",
2424
"_where": "/Users/amiransari/Projects/anyline-ocr-react-native-module1/example/RNExampleApp",
2525
"bugs": {
2626
"url": "https://github.com/Anyline/anyline-ocr-react-native-module/issues"
@@ -47,5 +47,5 @@
4747
"type": "git",
4848
"url": "git+https://github.com/Anyline/anyline-ocr-react-native-module.git"
4949
},
50-
"version": "43.0.0"
50+
"version": "43.0.1"
5151
}

0 commit comments

Comments
 (0)