anyline-ocr-react-native-module 53.2.0 → 54.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/android/.gradle/7.6/checksums/checksums.lock +0 -0
  2. package/android/.gradle/7.6/checksums/md5-checksums.bin +0 -0
  3. package/android/.gradle/7.6/checksums/sha1-checksums.bin +0 -0
  4. package/android/.gradle/7.6/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/7.6/dependencies-accessors/gc.properties +0 -0
  6. package/android/.gradle/7.6/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/7.6/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/7.6/fileHashes/fileHashes.bin +0 -0
  9. package/android/.gradle/7.6/fileHashes/fileHashes.lock +0 -0
  10. package/android/.gradle/7.6/gc.properties +0 -0
  11. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  12. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  13. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  14. package/android/.gradle/config.properties +2 -0
  15. package/android/.gradle/vcs-1/gc.properties +0 -0
  16. package/android/.idea/compiler.xml +6 -0
  17. package/android/.idea/gradle.xml +17 -0
  18. package/android/.idea/migrations.xml +10 -0
  19. package/android/.idea/misc.xml +10 -0
  20. package/android/.idea/other.xml +296 -0
  21. package/android/.idea/vcs.xml +6 -0
  22. package/android/build.gradle +1 -1
  23. package/android/local.properties +8 -0
  24. package/android/src/main/java/com/anyline/reactnative/AnylineSDKPlugin.java +16 -2
  25. package/android/src/main/java/com/anyline/reactnative/ScanActivity.java +15 -2
  26. package/ios/ALJsonUIConfiguration.m +3 -0
  27. package/ios/ALPluginHelper.h +1 -3
  28. package/ios/ALPluginHelper.m +27 -59
  29. package/ios/ALPluginScanViewController.h +1 -0
  30. package/ios/ALPluginScanViewController.m +23 -1
  31. package/ios/AnylineReact.podspec +3 -3
  32. package/ios/AnylineSDKPlugin.m +31 -42
  33. package/package.json +8 -8
  34. package/ios/ALNFCScanViewController.h +0 -14
  35. package/ios/ALNFCScanViewController.m +0 -452
File without changes
@@ -0,0 +1,2 @@
1
+ #Mon Aug 26 14:07:33 IST 2024
2
+ gradle.version=7.6
@@ -0,0 +1,2 @@
1
+ #Mon Aug 26 14:06:49 IST 2024
2
+ java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
File without changes
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="CompilerConfiguration">
4
+ <bytecodeTargetLevel target="17" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GradleSettings">
4
+ <option name="linkedExternalProjectsSettings">
5
+ <GradleProjectSettings>
6
+ <option name="externalProjectPath" value="$PROJECT_DIR$" />
7
+ <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
8
+ <option name="modules">
9
+ <set>
10
+ <option value="$PROJECT_DIR$" />
11
+ </set>
12
+ </option>
13
+ <option name="resolveExternalAnnotations" value="false" />
14
+ </GradleProjectSettings>
15
+ </option>
16
+ </component>
17
+ </project>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectMigrations">
4
+ <option name="MigrateToGradleLocalJavaHome">
5
+ <set>
6
+ <option value="$PROJECT_DIR$" />
7
+ </set>
8
+ </option>
9
+ </component>
10
+ </project>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ExternalStorageConfigurationManager" enabled="true" />
4
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
5
+ <output url="file://$PROJECT_DIR$/build/classes" />
6
+ </component>
7
+ <component name="ProjectType">
8
+ <option name="id" value="Android" />
9
+ </component>
10
+ </project>
@@ -0,0 +1,296 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="direct_access_persist.xml">
4
+ <option name="deviceSelectionList">
5
+ <list>
6
+ <PersistentDeviceSelectionData>
7
+ <option name="api" value="27" />
8
+ <option name="brand" value="DOCOMO" />
9
+ <option name="codename" value="F01L" />
10
+ <option name="id" value="F01L" />
11
+ <option name="manufacturer" value="FUJITSU" />
12
+ <option name="name" value="F-01L" />
13
+ <option name="screenDensity" value="360" />
14
+ <option name="screenX" value="720" />
15
+ <option name="screenY" value="1280" />
16
+ </PersistentDeviceSelectionData>
17
+ <PersistentDeviceSelectionData>
18
+ <option name="api" value="28" />
19
+ <option name="brand" value="DOCOMO" />
20
+ <option name="codename" value="SH-01L" />
21
+ <option name="id" value="SH-01L" />
22
+ <option name="manufacturer" value="SHARP" />
23
+ <option name="name" value="AQUOS sense2 SH-01L" />
24
+ <option name="screenDensity" value="480" />
25
+ <option name="screenX" value="1080" />
26
+ <option name="screenY" value="2160" />
27
+ </PersistentDeviceSelectionData>
28
+ <PersistentDeviceSelectionData>
29
+ <option name="api" value="31" />
30
+ <option name="brand" value="samsung" />
31
+ <option name="codename" value="a51" />
32
+ <option name="id" value="a51" />
33
+ <option name="manufacturer" value="Samsung" />
34
+ <option name="name" value="Galaxy A51" />
35
+ <option name="screenDensity" value="420" />
36
+ <option name="screenX" value="1080" />
37
+ <option name="screenY" value="2400" />
38
+ </PersistentDeviceSelectionData>
39
+ <PersistentDeviceSelectionData>
40
+ <option name="api" value="34" />
41
+ <option name="brand" value="google" />
42
+ <option name="codename" value="akita" />
43
+ <option name="id" value="akita" />
44
+ <option name="manufacturer" value="Google" />
45
+ <option name="name" value="Pixel 8a" />
46
+ <option name="screenDensity" value="420" />
47
+ <option name="screenX" value="1080" />
48
+ <option name="screenY" value="2400" />
49
+ </PersistentDeviceSelectionData>
50
+ <PersistentDeviceSelectionData>
51
+ <option name="api" value="33" />
52
+ <option name="brand" value="samsung" />
53
+ <option name="codename" value="b0q" />
54
+ <option name="id" value="b0q" />
55
+ <option name="manufacturer" value="Samsung" />
56
+ <option name="name" value="Galaxy S22 Ultra" />
57
+ <option name="screenDensity" value="600" />
58
+ <option name="screenX" value="1440" />
59
+ <option name="screenY" value="3088" />
60
+ </PersistentDeviceSelectionData>
61
+ <PersistentDeviceSelectionData>
62
+ <option name="api" value="32" />
63
+ <option name="brand" value="google" />
64
+ <option name="codename" value="bluejay" />
65
+ <option name="id" value="bluejay" />
66
+ <option name="manufacturer" value="Google" />
67
+ <option name="name" value="Pixel 6a" />
68
+ <option name="screenDensity" value="420" />
69
+ <option name="screenX" value="1080" />
70
+ <option name="screenY" value="2400" />
71
+ </PersistentDeviceSelectionData>
72
+ <PersistentDeviceSelectionData>
73
+ <option name="api" value="34" />
74
+ <option name="brand" value="google" />
75
+ <option name="codename" value="caiman" />
76
+ <option name="id" value="caiman" />
77
+ <option name="manufacturer" value="Google" />
78
+ <option name="name" value="Pixel 9 Pro" />
79
+ <option name="screenDensity" value="360" />
80
+ <option name="screenX" value="960" />
81
+ <option name="screenY" value="2142" />
82
+ </PersistentDeviceSelectionData>
83
+ <PersistentDeviceSelectionData>
84
+ <option name="api" value="34" />
85
+ <option name="brand" value="google" />
86
+ <option name="codename" value="comet" />
87
+ <option name="id" value="comet" />
88
+ <option name="manufacturer" value="Google" />
89
+ <option name="name" value="Pixel 9 Pro Fold" />
90
+ <option name="screenDensity" value="390" />
91
+ <option name="screenX" value="2076" />
92
+ <option name="screenY" value="2152" />
93
+ </PersistentDeviceSelectionData>
94
+ <PersistentDeviceSelectionData>
95
+ <option name="api" value="29" />
96
+ <option name="brand" value="samsung" />
97
+ <option name="codename" value="crownqlteue" />
98
+ <option name="id" value="crownqlteue" />
99
+ <option name="manufacturer" value="Samsung" />
100
+ <option name="name" value="Galaxy Note9" />
101
+ <option name="screenDensity" value="420" />
102
+ <option name="screenX" value="2220" />
103
+ <option name="screenY" value="1080" />
104
+ </PersistentDeviceSelectionData>
105
+ <PersistentDeviceSelectionData>
106
+ <option name="api" value="34" />
107
+ <option name="brand" value="samsung" />
108
+ <option name="codename" value="dm3q" />
109
+ <option name="id" value="dm3q" />
110
+ <option name="manufacturer" value="Samsung" />
111
+ <option name="name" value="Galaxy S23 Ultra" />
112
+ <option name="screenDensity" value="600" />
113
+ <option name="screenX" value="1440" />
114
+ <option name="screenY" value="3088" />
115
+ </PersistentDeviceSelectionData>
116
+ <PersistentDeviceSelectionData>
117
+ <option name="api" value="33" />
118
+ <option name="brand" value="google" />
119
+ <option name="codename" value="felix" />
120
+ <option name="id" value="felix" />
121
+ <option name="manufacturer" value="Google" />
122
+ <option name="name" value="Pixel Fold" />
123
+ <option name="screenDensity" value="420" />
124
+ <option name="screenX" value="2208" />
125
+ <option name="screenY" value="1840" />
126
+ </PersistentDeviceSelectionData>
127
+ <PersistentDeviceSelectionData>
128
+ <option name="api" value="33" />
129
+ <option name="brand" value="google" />
130
+ <option name="codename" value="felix_camera" />
131
+ <option name="id" value="felix_camera" />
132
+ <option name="manufacturer" value="Google" />
133
+ <option name="name" value="Pixel Fold (Camera-enabled)" />
134
+ <option name="screenDensity" value="420" />
135
+ <option name="screenX" value="2208" />
136
+ <option name="screenY" value="1840" />
137
+ </PersistentDeviceSelectionData>
138
+ <PersistentDeviceSelectionData>
139
+ <option name="api" value="33" />
140
+ <option name="brand" value="samsung" />
141
+ <option name="codename" value="gts8uwifi" />
142
+ <option name="id" value="gts8uwifi" />
143
+ <option name="manufacturer" value="Samsung" />
144
+ <option name="name" value="Galaxy Tab S8 Ultra" />
145
+ <option name="screenDensity" value="320" />
146
+ <option name="screenX" value="1848" />
147
+ <option name="screenY" value="2960" />
148
+ </PersistentDeviceSelectionData>
149
+ <PersistentDeviceSelectionData>
150
+ <option name="api" value="34" />
151
+ <option name="brand" value="google" />
152
+ <option name="codename" value="husky" />
153
+ <option name="id" value="husky" />
154
+ <option name="manufacturer" value="Google" />
155
+ <option name="name" value="Pixel 8 Pro" />
156
+ <option name="screenDensity" value="390" />
157
+ <option name="screenX" value="1008" />
158
+ <option name="screenY" value="2244" />
159
+ </PersistentDeviceSelectionData>
160
+ <PersistentDeviceSelectionData>
161
+ <option name="api" value="30" />
162
+ <option name="brand" value="motorola" />
163
+ <option name="codename" value="java" />
164
+ <option name="id" value="java" />
165
+ <option name="manufacturer" value="Motorola" />
166
+ <option name="name" value="G20" />
167
+ <option name="screenDensity" value="280" />
168
+ <option name="screenX" value="720" />
169
+ <option name="screenY" value="1600" />
170
+ </PersistentDeviceSelectionData>
171
+ <PersistentDeviceSelectionData>
172
+ <option name="api" value="34" />
173
+ <option name="brand" value="google" />
174
+ <option name="codename" value="komodo" />
175
+ <option name="id" value="komodo" />
176
+ <option name="manufacturer" value="Google" />
177
+ <option name="name" value="Pixel 9 Pro XL" />
178
+ <option name="screenDensity" value="360" />
179
+ <option name="screenX" value="1008" />
180
+ <option name="screenY" value="2244" />
181
+ </PersistentDeviceSelectionData>
182
+ <PersistentDeviceSelectionData>
183
+ <option name="api" value="33" />
184
+ <option name="brand" value="google" />
185
+ <option name="codename" value="lynx" />
186
+ <option name="id" value="lynx" />
187
+ <option name="manufacturer" value="Google" />
188
+ <option name="name" value="Pixel 7a" />
189
+ <option name="screenDensity" value="420" />
190
+ <option name="screenX" value="1080" />
191
+ <option name="screenY" value="2400" />
192
+ </PersistentDeviceSelectionData>
193
+ <PersistentDeviceSelectionData>
194
+ <option name="api" value="31" />
195
+ <option name="brand" value="google" />
196
+ <option name="codename" value="oriole" />
197
+ <option name="id" value="oriole" />
198
+ <option name="manufacturer" value="Google" />
199
+ <option name="name" value="Pixel 6" />
200
+ <option name="screenDensity" value="420" />
201
+ <option name="screenX" value="1080" />
202
+ <option name="screenY" value="2400" />
203
+ </PersistentDeviceSelectionData>
204
+ <PersistentDeviceSelectionData>
205
+ <option name="api" value="33" />
206
+ <option name="brand" value="google" />
207
+ <option name="codename" value="panther" />
208
+ <option name="id" value="panther" />
209
+ <option name="manufacturer" value="Google" />
210
+ <option name="name" value="Pixel 7" />
211
+ <option name="screenDensity" value="420" />
212
+ <option name="screenX" value="1080" />
213
+ <option name="screenY" value="2400" />
214
+ </PersistentDeviceSelectionData>
215
+ <PersistentDeviceSelectionData>
216
+ <option name="api" value="34" />
217
+ <option name="brand" value="samsung" />
218
+ <option name="codename" value="q5q" />
219
+ <option name="id" value="q5q" />
220
+ <option name="manufacturer" value="Samsung" />
221
+ <option name="name" value="Galaxy Z Fold5" />
222
+ <option name="screenDensity" value="420" />
223
+ <option name="screenX" value="1812" />
224
+ <option name="screenY" value="2176" />
225
+ </PersistentDeviceSelectionData>
226
+ <PersistentDeviceSelectionData>
227
+ <option name="api" value="30" />
228
+ <option name="brand" value="google" />
229
+ <option name="codename" value="r11" />
230
+ <option name="id" value="r11" />
231
+ <option name="manufacturer" value="Google" />
232
+ <option name="name" value="Pixel Watch" />
233
+ <option name="screenDensity" value="320" />
234
+ <option name="screenX" value="384" />
235
+ <option name="screenY" value="384" />
236
+ <option name="type" value="WEAR_OS" />
237
+ </PersistentDeviceSelectionData>
238
+ <PersistentDeviceSelectionData>
239
+ <option name="api" value="30" />
240
+ <option name="brand" value="google" />
241
+ <option name="codename" value="redfin" />
242
+ <option name="id" value="redfin" />
243
+ <option name="manufacturer" value="Google" />
244
+ <option name="name" value="Pixel 5" />
245
+ <option name="screenDensity" value="440" />
246
+ <option name="screenX" value="1080" />
247
+ <option name="screenY" value="2340" />
248
+ </PersistentDeviceSelectionData>
249
+ <PersistentDeviceSelectionData>
250
+ <option name="api" value="34" />
251
+ <option name="brand" value="google" />
252
+ <option name="codename" value="shiba" />
253
+ <option name="id" value="shiba" />
254
+ <option name="manufacturer" value="Google" />
255
+ <option name="name" value="Pixel 8" />
256
+ <option name="screenDensity" value="420" />
257
+ <option name="screenX" value="1080" />
258
+ <option name="screenY" value="2400" />
259
+ </PersistentDeviceSelectionData>
260
+ <PersistentDeviceSelectionData>
261
+ <option name="api" value="33" />
262
+ <option name="brand" value="google" />
263
+ <option name="codename" value="tangorpro" />
264
+ <option name="id" value="tangorpro" />
265
+ <option name="manufacturer" value="Google" />
266
+ <option name="name" value="Pixel Tablet" />
267
+ <option name="screenDensity" value="320" />
268
+ <option name="screenX" value="1600" />
269
+ <option name="screenY" value="2560" />
270
+ </PersistentDeviceSelectionData>
271
+ <PersistentDeviceSelectionData>
272
+ <option name="api" value="34" />
273
+ <option name="brand" value="google" />
274
+ <option name="codename" value="tokay" />
275
+ <option name="id" value="tokay" />
276
+ <option name="manufacturer" value="Google" />
277
+ <option name="name" value="Pixel 9" />
278
+ <option name="screenDensity" value="420" />
279
+ <option name="screenX" value="1080" />
280
+ <option name="screenY" value="2424" />
281
+ </PersistentDeviceSelectionData>
282
+ <PersistentDeviceSelectionData>
283
+ <option name="api" value="29" />
284
+ <option name="brand" value="samsung" />
285
+ <option name="codename" value="x1q" />
286
+ <option name="id" value="x1q" />
287
+ <option name="manufacturer" value="Samsung" />
288
+ <option name="name" value="Galaxy S20" />
289
+ <option name="screenDensity" value="480" />
290
+ <option name="screenX" value="1440" />
291
+ <option name="screenY" value="3200" />
292
+ </PersistentDeviceSelectionData>
293
+ </list>
294
+ </option>
295
+ </component>
296
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
5
+ </component>
6
+ </project>
@@ -61,7 +61,7 @@ repositories {
61
61
 
62
62
  dependencies {
63
63
  implementation fileTree(dir: "libs", include: ["*.jar"])
64
- implementation 'io.anyline:anylinesdk:53.2.0'
64
+ implementation 'io.anyline:anylinesdk:54.0.0'
65
65
  implementation "com.facebook.react:react-native:+"
66
66
  implementation("com.google.android.material:material:1.9.0")
67
67
  implementation 'androidx.multidex:multidex:2.0.1'
@@ -0,0 +1,8 @@
1
+ ## This file must *NOT* be checked into Version Control Systems,
2
+ # as it contains information specific to your local configuration.
3
+ #
4
+ # Location of the SDK. This is only used by Gradle.
5
+ # For customization when using a Version Control System, please read the
6
+ # header note.
7
+ #Mon Aug 26 14:06:49 IST 2024
8
+ sdk.dir=/Users/rohitlokhande/Library/Android/sdk
@@ -35,6 +35,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
35
35
  public static final String REACT_CLASS = "AnylineSDKPlugin";
36
36
  public static final String EXTRA_LICENSE_KEY = "EXTRA_LICENSE_KEY";
37
37
  public static final String EXTRA_CONFIG_JSON = "EXTRA_CONFIG_JSON";
38
+ public static final String EXTRA_SCANVIEW_INITIALIZATION_PARAMETERS = "EXTRA_SCANVIEW_INITIALIZATION_PARAMETERS";
38
39
  public static final String EXTRA_SCAN_MODE = "EXTRA_SCAN_MODE";
39
40
  public static final String EXTRA_ERROR_MESSAGE = "EXTRA_ERROR_MESSAGE";
40
41
  public static final String EXTRA_OCR_CONFIG_JSON = "EXTRA_OCR_CONFIG_JSON";
@@ -53,6 +54,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
53
54
  private Promise promise;
54
55
  private String returnMethod;
55
56
  private String config;
57
+ private String scanViewInitializationParameters;
56
58
  private AssetContextJsonParser assetContextJsonParser;
57
59
 
58
60
  private static WrapperConfig wrapperConfig;
@@ -175,10 +177,16 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
175
177
 
176
178
  @ReactMethod
177
179
  public void setup(String config, String scanMode, Callback onResultReact, Callback onErrorReact) {
180
+ setupWithInitializationParameters(null, config, scanMode, onResultReact, onErrorReact);
181
+ }
182
+
183
+ @ReactMethod
184
+ public void setupWithInitializationParameters(String initializationParameters, String config, String scanMode, Callback onResultReact, Callback onErrorReact) {
178
185
  onResultCallback = onResultReact;
179
186
  onErrorCallback = onErrorReact;
180
187
  this.returnMethod = "callback";
181
188
  this.config = config;
189
+ this.scanViewInitializationParameters = initializationParameters;
182
190
 
183
191
  routeScanMode(scanMode);
184
192
  }
@@ -226,9 +234,14 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
226
234
 
227
235
  @ReactMethod
228
236
  public void setupPromise(String config, String scanMode, final Promise promise) {
237
+ setupPromiseWithInitializationParameters(null, config, scanMode, promise);
238
+ }
239
+ @ReactMethod
240
+ public void setupPromiseWithInitializationParameters(String initializationParameters, String config, String scanMode, final Promise promise) {
229
241
  this.promise = promise;
230
242
  this.returnMethod = "promise";
231
243
  this.config = config;
244
+ this.scanViewInitializationParameters = initializationParameters;
232
245
 
233
246
  routeScanMode(scanMode);
234
247
  }
@@ -281,13 +294,14 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
281
294
 
282
295
  if (optionsJSONObject != null) {
283
296
  intent.putExtra(
284
- EXTRA_ENABLE_BARCODE_SCANNING,
285
- optionsJSONObject.optBoolean("nativeBarcodeEnabled", false)
297
+ EXTRA_ENABLE_BARCODE_SCANNING,
298
+ optionsJSONObject.optBoolean("nativeBarcodeEnabled", false)
286
299
  );
287
300
  }
288
301
 
289
302
  intent.putExtra(EXTRA_LICENSE_KEY, license);
290
303
  intent.putExtra(EXTRA_CONFIG_JSON, configObject.toString());
304
+ intent.putExtra(EXTRA_SCANVIEW_INITIALIZATION_PARAMETERS, scanViewInitializationParameters);
291
305
 
292
306
  ResultReporter.setListener(this);
293
307
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@@ -1,8 +1,10 @@
1
1
  package com.anyline.reactnative;
2
2
 
3
3
  import static com.anyline.reactnative.AnylineSDKPlugin.EXTRA_CONFIG_JSON;
4
+ import static com.anyline.reactnative.AnylineSDKPlugin.EXTRA_SCANVIEW_INITIALIZATION_PARAMETERS;
4
5
  import static com.anyline.reactnative.AnylineSDKPlugin.EXTRA_ERROR_MESSAGE;
5
6
  import static com.anyline.reactnative.AnylineSDKPlugin.RESULT_ERROR;
7
+ import static io.anyline2.sdk.extension.ScanViewInitializationParametersExtensionKt.getScanViewInitializationParametersFromJsonObject;
6
8
 
7
9
  import android.content.Intent;
8
10
  import android.content.pm.ActivityInfo;
@@ -29,6 +31,7 @@ import org.json.JSONObject;
29
31
  import java.util.Timer;
30
32
  import java.util.TimerTask;
31
33
 
34
+ import io.anyline.plugin.config.ScanViewInitializationParameters;
32
35
  import io.anyline2.ScanResult;
33
36
  import io.anyline2.view.ScanView;
34
37
  import io.anyline2.viewplugin.ScanViewPlugin;
@@ -98,7 +101,17 @@ public class ScanActivity extends AppCompatActivity {
98
101
  setupChangeOrientationButton(configJSON);
99
102
  setupCustomUIFeedback(configJSON);
100
103
 
101
- scanView.init(configJSON);
104
+ String initializationParametersString = getIntent().getStringExtra(EXTRA_SCANVIEW_INITIALIZATION_PARAMETERS);
105
+ if (initializationParametersString != null) {
106
+ ScanViewInitializationParameters scanViewInitializationParameters =
107
+ getScanViewInitializationParametersFromJsonObject(
108
+ this,
109
+ new JSONObject(initializationParametersString));
110
+ scanView.init(configJSON, scanViewInitializationParameters);
111
+ }
112
+ else {
113
+ scanView.init(configJSON);
114
+ }
102
115
 
103
116
  ViewPluginBase viewPluginBase = scanView.getScanViewPlugin();
104
117
 
@@ -364,7 +377,7 @@ public class ScanActivity extends AppCompatActivity {
364
377
  resultObject.put("fullImagePath", fullImagePath);
365
378
  resultObject.put("imagePath", cutoutImagePath);
366
379
  } catch (Exception e) {
367
- e.printStackTrace();
380
+ finishWithError("Error save scan image: " + e.getMessage());
368
381
  }
369
382
  return resultObject;
370
383
  }
@@ -208,6 +208,9 @@ NSString * const ENABLE_NATIVE_BARCODE = @"nativeBarcodeScanningFormats";
208
208
  }
209
209
 
210
210
  + (UIColor *)colorFromHexString:(NSString *)hexString {
211
+ if (!hexString) {
212
+ return nil;
213
+ }
211
214
  unsigned rgbValue = 0;
212
215
  NSScanner *scanner = [NSScanner scannerWithString:hexString];
213
216
  // [scanner setScanLocation:1]; // bypass '#' character
@@ -10,7 +10,7 @@ typedef void (^ALPluginCallback)(NSDictionary * _Nullable callbackObj, NSError *
10
10
 
11
11
  @interface ALPluginHelper : NSObject
12
12
 
13
- + (void)startScan:(NSDictionary *)config finished:(ALPluginCallback)callback;
13
+ + (void)startScan:(NSDictionary *)config initializationParamsStr:(NSString *)initializationParamsStr finished:(ALPluginCallback)callback;
14
14
 
15
15
  + (NSString *)saveImageToFileSystem:(UIImage *)image;
16
16
 
@@ -39,8 +39,6 @@ typedef void (^ALPluginCallback)(NSDictionary * _Nullable callbackObj, NSError *
39
39
 
40
40
  + (NSError *)errorWithMessage:(NSString *)message;
41
41
 
42
- + (NSDate *)formattedStringToDate:(NSString *)formattedStr;
43
-
44
42
  + (NSString *)stringForDate:(NSDate *)date;
45
43
 
46
44
  + (NSString * _Nullable)confPropKeyWithScanModeForPluginConfig:(ALPluginConfig *)pluginConfig;