Skip to content

Commit 521a136

Browse files
Release 51.4.0 (#173)
1 parent 3d36d24 commit 521a136

20 files changed

+275
-113
lines changed

example/RNExampleApp/android/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ android {
8787
minSdkVersion rootProject.ext.minSdkVersion
8888
targetSdkVersion rootProject.ext.targetSdkVersion
8989
versionCode 5
90-
versionName "51.3.1"
90+
versionName "51.4.0"
9191
multiDexEnabled true
9292

9393
buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())

example/RNExampleApp/config/TINDOTConfig.js

+82-28
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,7 @@ export default {
1111
"y": 0
1212
}
1313
},
14-
"defaultOrientation": "landscape",
15-
"instruction": {
16-
"text": "Please make sure the entire DOT number is inside the cutout.",
17-
},
18-
"feedback": {
19-
"format": {
20-
"text": "Wrong format detected",
21-
"image": "ic_wrong_format"
22-
},
23-
"brightness": {
24-
"too_high": {
25-
"text": "Too bright",
26-
"image": "ic_too_bright"
27-
},
28-
"too_low": {
29-
"text": "Too dark",
30-
"image": "ic_too_dark"
31-
}
32-
},
33-
"distance": {
34-
"text": "Position cutout correctly",
35-
"image": "ic_move_back"
36-
},
37-
"sound": "info_sound_TIN.wav"
38-
},
39-
"imageCutout": {
40-
"image": "dot_overlay"
41-
}
14+
"defaultOrientation": "landscape"
4215
},
4316
"cameraConfig": {
4417
"captureResolution": "1080p",
@@ -83,6 +56,87 @@ export default {
8356
"beepOnResult": true,
8457
"vibrateOnResult": false,
8558
"strokeWidth": 2
59+
},
60+
"uiFeedbackConfig": {
61+
"presets": [
62+
{
63+
"presetName": "tin_custom_v1",
64+
"presetAttributes": [
65+
{
66+
"attributeName": "lighting_toodark_image",
67+
"attributeValue": "uifeedback_tin_toodark"
68+
},
69+
{
70+
"attributeName": "lighting_toobright_image",
71+
"attributeValue": "uifeedback_tin_toobright"
72+
},
73+
{
74+
"attributeName": "distance_moveback_image",
75+
"attributeValue": "uifeedback_tin_moveback"
76+
},
77+
{
78+
"attributeName": "distance_movecloser_image",
79+
"attributeValue": "uifeedback_tin_movecloser"
80+
},
81+
{
82+
"attributeName": "format_wrong_image",
83+
"attributeValue": "uifeedback_tin_wrongformat"
84+
},
85+
{
86+
"attributeName": "date_wrong_image",
87+
"attributeValue": "uifeedback_tin_wrongformat"
88+
},
89+
{
90+
"attributeName": "lighting_toodark_text",
91+
"attributeValue": ""
92+
},
93+
{
94+
"attributeName": "lighting_toobright_text",
95+
"attributeValue": ""
96+
},
97+
{
98+
"attributeName": "distance_moveback_text",
99+
"attributeValue": ""
100+
},
101+
{
102+
"attributeName": "distance_movecloser_text",
103+
"attributeValue": ""
104+
},
105+
{
106+
"attributeName": "format_wrong_text",
107+
"attributeValue": ""
108+
},
109+
{
110+
"attributeName": "date_wrong_text",
111+
"attributeValue": ""
112+
},
113+
{
114+
"attributeName": "lighting_toodark_sound",
115+
"attributeValue": "info_sound_TIN.wav"
116+
},
117+
{
118+
"attributeName": "lighting_toobright_sound",
119+
"attributeValue": "info_sound_TIN.wav"
120+
},
121+
{
122+
"attributeName": "distance_moveback_sound",
123+
"attributeValue": "info_sound_TIN.wav"
124+
},
125+
{
126+
"attributeName": "distance_movecloser_sound",
127+
"attributeValue": "info_sound_TIN.wav"
128+
},
129+
{
130+
"attributeName": "format_wrong_sound",
131+
"attributeValue": "info_sound_TIN.wav"
132+
},
133+
{
134+
"attributeName": "date_wrong_sound",
135+
"attributeValue": "info_sound_TIN.wav"
136+
}
137+
]
138+
}
139+
]
86140
}
87141
}
88142
}

example/RNExampleApp/config/TINUniversalConfig.js

+81-27
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,6 @@ export default {
99
"x": 0,
1010
"y": 0
1111
}
12-
},
13-
"instruction": {
14-
"text": "Please make sure the entire DOT number is inside the cutout.",
15-
},
16-
"feedback": {
17-
"format": {
18-
"text": "Wrong format detected",
19-
"image": "ic_wrong_format"
20-
},
21-
"brightness": {
22-
"too_high": {
23-
"text": "Too bright",
24-
"image": "ic_too_bright"
25-
},
26-
"too_low": {
27-
"text": "Too dark",
28-
"image": "ic_too_dark"
29-
}
30-
},
31-
"distance": {
32-
"text": "Position cutout correctly",
33-
"image": "ic_move_back"
34-
},
35-
"sound": "info_sound_TIN.wav"
36-
},
37-
"imageCutout": {
38-
"image": "dot_overlay"
3912
}
4013
},
4114
"cameraConfig": {
@@ -81,6 +54,87 @@ export default {
8154
"beepOnResult": true,
8255
"vibrateOnResult": false,
8356
"strokeWidth": 2
57+
},
58+
"uiFeedbackConfig": {
59+
"presets": [
60+
{
61+
"presetName": "tin_custom_v1",
62+
"presetAttributes": [
63+
{
64+
"attributeName": "lighting_toodark_image",
65+
"attributeValue": "uifeedback_tin_toodark"
66+
},
67+
{
68+
"attributeName": "lighting_toobright_image",
69+
"attributeValue": "uifeedback_tin_toobright"
70+
},
71+
{
72+
"attributeName": "distance_moveback_image",
73+
"attributeValue": "uifeedback_tin_moveback"
74+
},
75+
{
76+
"attributeName": "distance_movecloser_image",
77+
"attributeValue": "uifeedback_tin_movecloser"
78+
},
79+
{
80+
"attributeName": "format_wrong_image",
81+
"attributeValue": "uifeedback_tin_wrongformat"
82+
},
83+
{
84+
"attributeName": "date_wrong_image",
85+
"attributeValue": "uifeedback_tin_wrongformat"
86+
},
87+
{
88+
"attributeName": "lighting_toodark_text",
89+
"attributeValue": ""
90+
},
91+
{
92+
"attributeName": "lighting_toobright_text",
93+
"attributeValue": ""
94+
},
95+
{
96+
"attributeName": "distance_moveback_text",
97+
"attributeValue": ""
98+
},
99+
{
100+
"attributeName": "distance_movecloser_text",
101+
"attributeValue": ""
102+
},
103+
{
104+
"attributeName": "format_wrong_text",
105+
"attributeValue": ""
106+
},
107+
{
108+
"attributeName": "date_wrong_text",
109+
"attributeValue": ""
110+
},
111+
{
112+
"attributeName": "lighting_toodark_sound",
113+
"attributeValue": "info_sound_TIN.wav"
114+
},
115+
{
116+
"attributeName": "lighting_toobright_sound",
117+
"attributeValue": "info_sound_TIN.wav"
118+
},
119+
{
120+
"attributeName": "distance_moveback_sound",
121+
"attributeValue": "info_sound_TIN.wav"
122+
},
123+
{
124+
"attributeName": "distance_movecloser_sound",
125+
"attributeValue": "info_sound_TIN.wav"
126+
},
127+
{
128+
"attributeName": "format_wrong_sound",
129+
"attributeValue": "info_sound_TIN.wav"
130+
},
131+
{
132+
"attributeName": "date_wrong_sound",
133+
"attributeValue": "info_sound_TIN.wav"
134+
}
135+
]
136+
}
137+
]
84138
}
85139
}
86140
}

example/RNExampleApp/ios/RNExampleApp.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
inputPaths = (
235235
"${PODS_ROOT}/Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp-resources.sh",
236236
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
237-
"${PODS_ROOT}/Anyline/AnylineSDK_iOS_51.3.1/Framework/AnylineResources.bundle",
237+
"${PODS_ROOT}/Anyline/AnylineSDK_iOS_51.4.0/Framework/AnylineResources.bundle",
238238
);
239239
name = "[CP] Copy Pods Resources";
240240
outputPaths = (
@@ -365,7 +365,7 @@
365365
INFOPLIST_FILE = RNExampleApp/Info.plist;
366366
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
367367
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
368-
MARKETING_VERSION = 51.3.1;
368+
MARKETING_VERSION = 51.4.0;
369369
OTHER_LDFLAGS = (
370370
"$(inherited)",
371371
"-ObjC",
@@ -398,7 +398,7 @@
398398
INFOPLIST_FILE = RNExampleApp/Info.plist;
399399
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
400400
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
401-
MARKETING_VERSION = 51.3.1;
401+
MARKETING_VERSION = 51.4.0;
402402
OTHER_LDFLAGS = (
403403
"$(inherited)",
404404
"-ObjC",

example/RNExampleApp/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-example-app",
3-
"version": "51.3.1",
3+
"version": "51.4.0",
44
"private": true,
55
"scripts": {
66
"initProject": "yarn add expo && yarn add ../../plugin",

example/RNExampleApp/src/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class Anyline extends Component {
6565
currentScanMode: '',
6666
buttonsDisabled: false,
6767
SDKVersion: '',
68+
pluginVersion: '',
6869
hasMultipleResults: false,
6970
licenseMessage: '',
7071
titles: [],
@@ -89,8 +90,9 @@ class Anyline extends Component {
8990
}
9091

9192
const SDKVersion = await AnylineOCR.getSDKVersion();
93+
const pluginVersion = AnylineOCR.getPluginVersion();
9294

93-
this.setState({ SDKVersion: SDKVersion, licenseMessage: licenseMessage, buttonsDisabled: !licenseInitSuccess });
95+
this.setState({ SDKVersion: SDKVersion, pluginVersion: pluginVersion, licenseMessage: licenseMessage, buttonsDisabled: !licenseInitSuccess });
9496
};
9597

9698
componentDidUpdate() {
@@ -355,6 +357,7 @@ class Anyline extends Component {
355357
currentScanMode,
356358
buttonsDisabled,
357359
SDKVersion,
360+
pluginVersion,
358361
licenseMessage,
359362
hasMultipleResults,
360363
titles,
@@ -416,6 +419,7 @@ class Anyline extends Component {
416419

417420
<View style={styles.footer}>
418421
<Text style={styles.versions}>SDK: {SDKVersion}</Text>
422+
<Text style={styles.versions}>Plugin: {pluginVersion}</Text>
419423
{
420424
(licenseMessage && licenseMessage.length > 0) ?
421425
<Text key='licenseMessage' style={styles.versions}>

plugin/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ repositories {
6161

6262
dependencies {
6363
implementation fileTree(dir: "libs", include: ["*.jar"])
64-
implementation 'io.anyline:anylinesdk:51.3.1'
64+
implementation 'io.anyline:anylinesdk:51.4.0'
6565
implementation "com.facebook.react:react-native:+"
6666
implementation("com.google.android.material:material:1.9.0")
6767
implementation 'androidx.multidex:multidex:2.0.1'
Binary file not shown.

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

+14-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import java.io.IOException;
2121
import java.util.HashMap;
2222

23+
import io.anyline2.WrapperConfig;
24+
import io.anyline2.WrapperInfo;
2325
import io.anyline2.core.ScanController;
2426
import io.anyline2.legacy.products.AnylineUpdater;
2527
import io.anyline2.legacy.trainer.AssetContext;
@@ -53,6 +55,8 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
5355
private String config;
5456
private AssetContextJsonParser assetContextJsonParser;
5557

58+
private static WrapperConfig wrapperConfig;
59+
5660
AnylineSDKPlugin(ReactApplicationContext context) {
5761
super(context);
5862
this.reactContext = context;
@@ -69,6 +73,13 @@ public void getSDKVersion(final Promise promise) {
6973
promise.resolve(at.nineyards.anyline.BuildConfig.VERSION_NAME);
7074
}
7175

76+
@ReactMethod
77+
protected void setPluginVersion(final String pluginVersion) {
78+
wrapperConfig = new WrapperConfig.Wrapper(
79+
new WrapperInfo(WrapperInfo.WrapperType.ReactNative, pluginVersion)
80+
);
81+
}
82+
7283
@ReactMethod
7384
public void licenseKeyExpiryDate(final Promise promise) {
7485
try {
@@ -125,7 +136,7 @@ public void setupAnylineSDKWithCacheConfig(String license, boolean enableOffline
125136
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
126137
}
127138
try {
128-
AnylineSdk.init(license, reactContext, "", cacheConfig);
139+
AnylineSdk.init(license, reactContext, "", cacheConfig, wrapperConfig);
129140
this.license = license;
130141
if (promise != null) {
131142
promise.resolve(true);
@@ -150,7 +161,7 @@ public void initSdk(String license, boolean enableOfflineCache) {
150161
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
151162
}
152163
try {
153-
AnylineSdk.init(license, reactContext, "", cacheConfig);
164+
AnylineSdk.init(license, reactContext, "", cacheConfig, wrapperConfig);
154165
} catch (LicenseException e) {
155166
e.printStackTrace();
156167
returnError(e.getMessage());
@@ -259,7 +270,7 @@ private void scan() throws LicenseException, JSONException {
259270
if (configObject.has("license")) {
260271
//if there is a license on JSON config then this license will be
261272
//used to init or re-init the SDK
262-
AnylineSdk.init(configObject.getString("license"), reactContext);
273+
AnylineSdk.init(configObject.getString("license"), reactContext, "", CacheConfig.Preset.Default.INSTANCE, wrapperConfig);
263274
license = configObject.get("license").toString();
264275
} else {
265276
throw new JSONException("No License in config. Please check your configuration.");

0 commit comments

Comments
 (0)