anyline-ocr-react-native-module 48.0.1 → 51.1.1
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.
- package/README.md +2 -2
- package/android/.gradle/7.6/checksums/checksums.lock +0 -0
- package/android/.gradle/7.6/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.6/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.idea/PipelineViewerConfig.xml +6 -0
- package/android/.idea/gradle.xml +1 -0
- package/android/build.gradle +5 -21
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/assets/cow_tag_scanner.ale +0 -1
- package/android/src/main/java/com/anyline/reactnative/AnylineSDKPlugin.java +62 -18
- package/android/src/main/res/layout/activity_scan.xml +20 -17
- package/ios/ALNFCScanViewController.m +5 -5
- package/ios/ALPluginScanViewController.m +7 -7
- package/ios/AnylineReact.podspec +1 -1
- package/ios/AnylineSDKPlugin.m +24 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -19,11 +19,11 @@ The plugin enables the connection to the SDK via React-Native.
|
|
|
19
19
|
|
|
20
20
|
## Getting Started
|
|
21
21
|
|
|
22
|
-
Check out our getting-started section here: https://documentation
|
|
22
|
+
Check out our getting-started section here: https://documentation.anyline.com/react-native-plugin-component/latest/getting-started.html
|
|
23
23
|
|
|
24
24
|
## Documentation
|
|
25
25
|
|
|
26
|
-
Check out our developer guide here: https://documentation
|
|
26
|
+
Check out our developer guide here: https://documentation.anyline.com/react-native-plugin-component/latest/index.html
|
|
27
27
|
|
|
28
28
|
## License
|
|
29
29
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/.idea/gradle.xml
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<option name="testRunner" value="GRADLE" />
|
|
8
8
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
9
9
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
10
|
+
<option name="gradleJvm" value="11" />
|
|
10
11
|
<option name="modules">
|
|
11
12
|
<set>
|
|
12
13
|
<option value="$PROJECT_DIR$" />
|
package/android/build.gradle
CHANGED
|
@@ -6,7 +6,7 @@ buildscript {
|
|
|
6
6
|
mavenCentral()
|
|
7
7
|
}
|
|
8
8
|
dependencies {
|
|
9
|
-
classpath 'com.android.tools.build:gradle:4.
|
|
9
|
+
classpath 'com.android.tools.build:gradle:7.4.2'
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -22,6 +22,7 @@ android {
|
|
|
22
22
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
23
23
|
|
|
24
24
|
defaultConfig {
|
|
25
|
+
namespace "com.anyline.reactnative"
|
|
25
26
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
26
27
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
27
28
|
versionCode 1
|
|
@@ -42,16 +43,10 @@ android {
|
|
|
42
43
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
packagingOptions {
|
|
46
|
-
pickFirst('lib/*/libgnustl_shared.so')
|
|
47
|
-
pickFirst('lib/*/libopencv_java3.so')
|
|
48
|
-
}
|
|
49
|
-
|
|
50
46
|
compileOptions {
|
|
51
47
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
52
48
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
53
49
|
}
|
|
54
|
-
|
|
55
50
|
buildFeatures {
|
|
56
51
|
viewBinding true
|
|
57
52
|
dataBinding true
|
|
@@ -59,9 +54,6 @@ android {
|
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
repositories {
|
|
62
|
-
flatDir {
|
|
63
|
-
dirs 'libs'
|
|
64
|
-
}
|
|
65
57
|
maven {
|
|
66
58
|
url 'https://anylinesdk.blob.core.windows.net/maven/'
|
|
67
59
|
}
|
|
@@ -69,16 +61,8 @@ repositories {
|
|
|
69
61
|
|
|
70
62
|
dependencies {
|
|
71
63
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
72
|
-
implementation 'io.anyline:anylinesdk:
|
|
73
|
-
implementation "com.facebook.react:react-native:+"
|
|
74
|
-
implementation("com.google.android.material:material:1.
|
|
64
|
+
implementation 'io.anyline:anylinesdk:51.1.0'
|
|
65
|
+
implementation "com.facebook.react:react-native:+"
|
|
66
|
+
implementation("com.google.android.material:material:1.9.0")
|
|
75
67
|
implementation 'androidx.multidex:multidex:2.0.1'
|
|
76
|
-
constraints {
|
|
77
|
-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
|
|
78
|
-
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
|
|
79
|
-
}
|
|
80
|
-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
|
|
81
|
-
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
68
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
package="com.anyline.reactnative">
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
4
3
|
|
|
5
4
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
6
5
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
|
@@ -17,11 +17,14 @@ import com.facebook.react.bridge.ReactMethod;
|
|
|
17
17
|
import org.json.JSONException;
|
|
18
18
|
import org.json.JSONObject;
|
|
19
19
|
|
|
20
|
-
import io.
|
|
20
|
+
import java.io.IOException;
|
|
21
|
+
import java.util.HashMap;
|
|
22
|
+
|
|
21
23
|
import io.anyline.products.AnylineUpdater;
|
|
22
24
|
import io.anyline.trainer.AssetContext;
|
|
23
|
-
import io.anyline.trainer.TrainerUtils;
|
|
24
25
|
import io.anyline2.AnylineSdk;
|
|
26
|
+
import io.anyline2.CacheConfig;
|
|
27
|
+
import io.anyline2.CorrectedResultReporting;
|
|
25
28
|
import io.anyline2.core.LicenseException;
|
|
26
29
|
|
|
27
30
|
class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultReporter.OnResultListener {
|
|
@@ -110,8 +113,17 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
110
113
|
|
|
111
114
|
@ReactMethod
|
|
112
115
|
public void setupAnylineSDK(String license, final Promise promise) {
|
|
116
|
+
setupAnylineSDKWithCacheConfig(license, false, promise);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@ReactMethod
|
|
120
|
+
public void setupAnylineSDKWithCacheConfig(String license, boolean enableOfflineCache, final Promise promise) {
|
|
121
|
+
CacheConfig.Preset cacheConfig = CacheConfig.Preset.Default.INSTANCE;
|
|
122
|
+
if (enableOfflineCache) {
|
|
123
|
+
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
|
|
124
|
+
}
|
|
113
125
|
try {
|
|
114
|
-
AnylineSdk.init(license, reactContext);
|
|
126
|
+
AnylineSdk.init(license, reactContext, "", cacheConfig);
|
|
115
127
|
this.license = license;
|
|
116
128
|
if (promise != null) {
|
|
117
129
|
promise.resolve(true);
|
|
@@ -126,8 +138,17 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
126
138
|
|
|
127
139
|
@ReactMethod
|
|
128
140
|
public void initSdk(String license) {
|
|
141
|
+
initSdk(license, false);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@ReactMethod
|
|
145
|
+
public void initSdk(String license, boolean enableOfflineCache) {
|
|
146
|
+
CacheConfig.Preset cacheConfig = CacheConfig.Preset.Default.INSTANCE;
|
|
147
|
+
if (enableOfflineCache) {
|
|
148
|
+
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
|
|
149
|
+
}
|
|
129
150
|
try {
|
|
130
|
-
AnylineSdk.init(license, reactContext);
|
|
151
|
+
AnylineSdk.init(license, reactContext, "", cacheConfig);
|
|
131
152
|
} catch (LicenseException e) {
|
|
132
153
|
e.printStackTrace();
|
|
133
154
|
returnError(e.getMessage());
|
|
@@ -151,19 +172,43 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
151
172
|
|
|
152
173
|
@ReactMethod
|
|
153
174
|
public void reportCorrectedResult(String blobKey, String correctedResult, Callback onResponseCallback) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
175
|
+
HashMap<String, String> hashMap = new HashMap<>();
|
|
176
|
+
hashMap.put("result", correctedResult);
|
|
177
|
+
|
|
178
|
+
try {
|
|
179
|
+
CorrectedResultReporting
|
|
180
|
+
.Factory
|
|
181
|
+
.getInstance()
|
|
182
|
+
.reportCorrectedResult(
|
|
183
|
+
blobKey,
|
|
184
|
+
hashMap
|
|
185
|
+
);
|
|
186
|
+
onResponseCallback.invoke("Success");
|
|
187
|
+
}
|
|
188
|
+
catch (IllegalArgumentException e) {
|
|
189
|
+
onResponseCallback.invoke("Error: " + e.getMessage());
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@ReactMethod
|
|
194
|
+
public void exportCachedEvents(final Promise promise) {
|
|
195
|
+
try {
|
|
196
|
+
String exportedFile = AnylineSdk.exportCachedEvents();
|
|
197
|
+
if (exportedFile != null) {
|
|
198
|
+
if (promise != null) {
|
|
199
|
+
promise.resolve(String.valueOf(exportedFile));
|
|
165
200
|
}
|
|
166
|
-
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
if (promise != null) {
|
|
204
|
+
promise.reject(E_ERROR, "Event cache is empty.");
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
} catch (IOException e) {
|
|
208
|
+
if (promise != null) {
|
|
209
|
+
promise.reject(E_ERROR, e.getMessage());
|
|
210
|
+
}
|
|
211
|
+
}
|
|
167
212
|
}
|
|
168
213
|
|
|
169
214
|
@ReactMethod
|
|
@@ -214,8 +259,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
|
|
|
214
259
|
//used to init or re-init the SDK
|
|
215
260
|
AnylineSdk.init(configObject.getString("license"), reactContext);
|
|
216
261
|
license = configObject.get("license").toString();
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
262
|
+
} else {
|
|
219
263
|
throw new JSONException("No License in config. Please check your configuration.");
|
|
220
264
|
}
|
|
221
265
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
3
2
|
android:layout_width="match_parent"
|
|
4
3
|
android:layout_height="match_parent">
|
|
5
4
|
|
|
6
5
|
<io.anyline2.view.ScanView
|
|
7
6
|
android:id="@+id/scan_view"
|
|
8
7
|
android:layout_width="match_parent"
|
|
9
|
-
android:layout_height="match_parent"
|
|
10
|
-
app:api_2_enabled="false" />
|
|
8
|
+
android:layout_height="match_parent" />
|
|
11
9
|
|
|
12
10
|
<LinearLayout
|
|
13
11
|
android:id="@+id/layout_change_orientation"
|
|
@@ -16,12 +14,13 @@
|
|
|
16
14
|
android:layout_gravity="right|top"
|
|
17
15
|
android:gravity="center"
|
|
18
16
|
android:padding="40px">
|
|
17
|
+
|
|
19
18
|
<ImageView
|
|
20
19
|
android:id="@+id/imageview_change_orientation"
|
|
21
20
|
android:layout_width="56dp"
|
|
22
21
|
android:layout_height="56dp"
|
|
23
|
-
android:scaleType="fitStart"
|
|
24
22
|
android:background="@drawable/rotate_screen_background"
|
|
23
|
+
android:scaleType="fitStart"
|
|
25
24
|
android:src="@drawable/rotate_screen_white" />
|
|
26
25
|
</LinearLayout>
|
|
27
26
|
|
|
@@ -29,12 +28,13 @@
|
|
|
29
28
|
android:id="@+id/layout_instruction"
|
|
30
29
|
android:layout_width="match_parent"
|
|
31
30
|
android:layout_height="wrap_content"
|
|
32
|
-
android:visibility="gone"
|
|
33
31
|
android:layout_gravity="bottom"
|
|
34
|
-
android:gravity="bottom"
|
|
35
32
|
android:layout_marginVertical="30dp"
|
|
33
|
+
android:gravity="bottom"
|
|
34
|
+
android:orientation="vertical"
|
|
36
35
|
android:paddingBottom="30dp"
|
|
37
|
-
android:
|
|
36
|
+
android:visibility="gone">
|
|
37
|
+
|
|
38
38
|
<TextView
|
|
39
39
|
android:id="@+id/textview_instruction"
|
|
40
40
|
android:layout_width="match_parent"
|
|
@@ -50,41 +50,44 @@
|
|
|
50
50
|
android:id="@+id/layout_bright_distance_feedback"
|
|
51
51
|
android:layout_width="match_parent"
|
|
52
52
|
android:layout_height="wrap_content"
|
|
53
|
-
android:visibility="gone"
|
|
54
53
|
android:layout_centerHorizontal="true"
|
|
55
54
|
android:layout_gravity="top"
|
|
56
55
|
android:gravity="top|center_horizontal"
|
|
56
|
+
android:orientation="vertical"
|
|
57
57
|
android:paddingTop="20dp"
|
|
58
58
|
android:paddingBottom="5dp"
|
|
59
|
-
android:
|
|
59
|
+
android:visibility="gone">
|
|
60
|
+
|
|
60
61
|
<ImageView
|
|
61
62
|
android:id="@+id/imageview_bright_distance_feedback"
|
|
62
63
|
android:layout_width="wrap_content"
|
|
63
64
|
android:layout_height="wrap_content"
|
|
64
|
-
android:
|
|
65
|
-
android:scaleType="centerInside"
|
|
65
|
+
android:layout_marginVertical="5dp"
|
|
66
66
|
android:layout_weight="2"
|
|
67
|
-
android:
|
|
67
|
+
android:gravity="top|center_horizontal"
|
|
68
|
+
android:scaleType="centerInside" />
|
|
69
|
+
|
|
68
70
|
<TextView
|
|
69
71
|
android:id="@+id/textview_bright_distance_feedback"
|
|
70
72
|
android:layout_width="wrap_content"
|
|
71
73
|
android:layout_height="wrap_content"
|
|
74
|
+
android:layout_weight="0"
|
|
72
75
|
android:gravity="top|center_horizontal"
|
|
73
76
|
android:text=""
|
|
74
77
|
android:textColor="@color/white"
|
|
75
|
-
android:textSize="14sp"
|
|
76
|
-
|
|
78
|
+
android:textSize="14sp" />
|
|
79
|
+
|
|
77
80
|
<LinearLayout
|
|
78
81
|
android:layout_width="match_parent"
|
|
79
82
|
android:layout_height="wrap_content"
|
|
80
83
|
android:layout_weight="3"
|
|
81
|
-
android:orientation="vertical"/>
|
|
84
|
+
android:orientation="vertical" />
|
|
82
85
|
</LinearLayout>
|
|
83
86
|
|
|
84
87
|
<ImageView
|
|
85
88
|
android:id="@+id/imageview_cutout_overlay"
|
|
86
89
|
android:layout_width="wrap_content"
|
|
87
90
|
android:layout_height="wrap_content"
|
|
88
|
-
android:
|
|
89
|
-
android:
|
|
91
|
+
android:scaleType="fitStart"
|
|
92
|
+
android:visibility="gone" />
|
|
90
93
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@@ -162,7 +162,7 @@ API_AVAILABLE(ios(13.0))
|
|
|
162
162
|
ALCutoutConfig *cutoutConfig = scanViewPlugin.scanViewPluginConfig.cutoutConfig;
|
|
163
163
|
ALScanFeedbackConfig *scanFeedbackConfig = scanViewPlugin.scanViewPluginConfig.scanFeedbackConfig;
|
|
164
164
|
|
|
165
|
-
ALPluginConfig *pluginConfig = scanViewPlugin.scanPlugin.
|
|
165
|
+
ALPluginConfig *pluginConfig = scanViewPlugin.scanPlugin.pluginConfig;
|
|
166
166
|
ALMrzConfig *mrzConfig = pluginConfig.mrzConfig;
|
|
167
167
|
|
|
168
168
|
// a bit lengthy but this is how you properly change the config (mrzFieldScanOptions and mrzMinFieldConfidences)
|
|
@@ -182,9 +182,9 @@ API_AVAILABLE(ios(13.0))
|
|
|
182
182
|
mrzConfig.mrzMinFieldConfidences.dateOfExpiry = @(90);
|
|
183
183
|
|
|
184
184
|
NSError *error;
|
|
185
|
-
ALScanViewPluginConfig *scanViewPluginConfig = [ALScanViewPluginConfig
|
|
186
|
-
|
|
187
|
-
|
|
185
|
+
ALScanViewPluginConfig *scanViewPluginConfig = [ALScanViewPluginConfig withPluginConfig:pluginConfig
|
|
186
|
+
cutoutConfig:cutoutConfig
|
|
187
|
+
scanFeedbackConfig:scanFeedbackConfig];
|
|
188
188
|
ALScanViewPlugin *updatedScanViewPlugin = [[ALScanViewPlugin alloc] initWithConfig:scanViewPluginConfig error:&error];
|
|
189
189
|
[self.scanView setScanViewPlugin:updatedScanViewPlugin error:&error];
|
|
190
190
|
|
|
@@ -245,7 +245,7 @@ API_AVAILABLE(ios(13.0))
|
|
|
245
245
|
NSObject<ALScanViewPluginBase> *scanViewPluginBase = self.scanView.scanViewPlugin;
|
|
246
246
|
if ([scanViewPluginBase isKindOfClass:ALScanViewPlugin.class]) {
|
|
247
247
|
ALScanViewPlugin *scanViewPlugin = (ALScanViewPlugin *)scanViewPluginBase;
|
|
248
|
-
BOOL cancelOnResult = scanViewPlugin.scanPlugin.
|
|
248
|
+
BOOL cancelOnResult = scanViewPlugin.scanPlugin.pluginConfig.cancelOnResult;
|
|
249
249
|
if (cancelOnResult) {
|
|
250
250
|
[self dismissViewControllerAnimated:YES completion:nil];
|
|
251
251
|
}
|
|
@@ -76,6 +76,8 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
NSString *appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
|
|
80
|
+
|
|
79
81
|
self.scanView = [ALScanViewFactory withJSONDictionary:self.config
|
|
80
82
|
delegate:self
|
|
81
83
|
error:&error];
|
|
@@ -202,7 +204,7 @@
|
|
|
202
204
|
NSObject<ALScanViewPluginBase> *scanViewPluginBase = self.scanView.scanViewPlugin;
|
|
203
205
|
if ([scanViewPluginBase isKindOfClass:ALScanViewPlugin.class]) {
|
|
204
206
|
ALScanViewPlugin *scanViewPlugin = (ALScanViewPlugin *)scanViewPluginBase;
|
|
205
|
-
BOOL cancelOnResult = scanViewPlugin.scanPlugin.
|
|
207
|
+
BOOL cancelOnResult = scanViewPlugin.scanPlugin.pluginConfig.cancelOnResult;
|
|
206
208
|
if (cancelOnResult) {
|
|
207
209
|
__weak __block typeof(self) weakSelf = self;
|
|
208
210
|
[self dismissViewControllerAnimated:YES completion:^{
|
|
@@ -290,7 +292,7 @@
|
|
|
290
292
|
// applic. only to non-composites
|
|
291
293
|
NSObject<ALScanViewPluginBase> *scanVwPluginBase = self.scanView.scanViewPlugin;
|
|
292
294
|
if ([scanVwPluginBase isKindOfClass:ALScanViewPlugin.class]) {
|
|
293
|
-
return ((ALScanViewPlugin *)scanVwPluginBase).scanPlugin.
|
|
295
|
+
return ((ALScanViewPlugin *)scanVwPluginBase).scanPlugin.pluginConfig;
|
|
294
296
|
}
|
|
295
297
|
return nil;
|
|
296
298
|
}
|
|
@@ -355,12 +357,10 @@
|
|
|
355
357
|
|
|
356
358
|
// assume that pluginConfig carries the updated scanMode or whatever value that you wish to refresh.
|
|
357
359
|
- (BOOL)updatePluginConfig:(ALPluginConfig *)pluginConfig error:(NSError * _Nullable * _Nullable)error {
|
|
358
|
-
|
|
359
|
-
ALScanPluginConfig *scanPluginConfig = [[ALScanPluginConfig alloc] initWithPluginConfig:pluginConfig];
|
|
360
360
|
ALScanViewPluginConfig *origSVPConfig = ((ALScanViewPlugin *)self.scanView.scanViewPlugin).scanViewPluginConfig;
|
|
361
|
-
ALScanViewPluginConfig *scanViewPluginConfig = [ALScanViewPluginConfig
|
|
362
|
-
|
|
363
|
-
|
|
361
|
+
ALScanViewPluginConfig *scanViewPluginConfig = [ALScanViewPluginConfig withPluginConfig:pluginConfig
|
|
362
|
+
cutoutConfig:origSVPConfig.cutoutConfig
|
|
363
|
+
scanFeedbackConfig:origSVPConfig.scanFeedbackConfig];
|
|
364
364
|
ALScanViewPlugin *newScanViewPlugin = [[ALScanViewPlugin alloc] initWithConfig:scanViewPluginConfig error:error];
|
|
365
365
|
if (!newScanViewPlugin) {
|
|
366
366
|
return NO;
|
package/ios/AnylineReact.podspec
CHANGED
|
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
|
|
|
18
18
|
s.source = { :git => "https://github.com/Anyline/anyline-ocr-react-native-module.git", :tag => "#{s.version}" }
|
|
19
19
|
|
|
20
20
|
s.source_files = "*.{h,m}"
|
|
21
|
-
s.dependency "Anyline", "~>
|
|
21
|
+
s.dependency "Anyline", "~> 51"
|
|
22
22
|
s.dependency "React"
|
|
23
23
|
|
|
24
24
|
end
|
package/ios/AnylineSDKPlugin.m
CHANGED
|
@@ -56,6 +56,13 @@ RCT_EXPORT_METHOD(setup:(NSString *)config scanMode:(NSString *)scanMode onResul
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
RCT_EXPORT_METHOD(setupAnylineSDK:(NSString *)licenseKey
|
|
59
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
60
|
+
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
61
|
+
[self setupAnylineSDKWithCacheConfig:licenseKey enableOfflineCache:NO resolver:resolve rejecter:reject];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
RCT_EXPORT_METHOD(setupAnylineSDKWithCacheConfig:(NSString *)licenseKey
|
|
65
|
+
enableOfflineCache:(BOOL)enableOfflineCache
|
|
59
66
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
60
67
|
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
61
68
|
|
|
@@ -103,6 +110,23 @@ RCT_EXPORT_METHOD(licenseKeyExpiryDate:(RCTPromiseResolveBlock)resolve rejecter:
|
|
|
103
110
|
resolve([AnylineSDK licenseExpirationDate]);
|
|
104
111
|
}
|
|
105
112
|
|
|
113
|
+
RCT_EXPORT_METHOD(exportCachedEvents:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
114
|
+
_resolveBlock = resolve;
|
|
115
|
+
_rejectBlock = reject;
|
|
116
|
+
self.returnMethod = @"promise";
|
|
117
|
+
|
|
118
|
+
NSError *error;
|
|
119
|
+
NSString *exportPath = [AnylineSDK exportCachedEvents:&error];
|
|
120
|
+
|
|
121
|
+
if (!exportPath) {
|
|
122
|
+
NSString *errorString = @"Event cache is empty.";
|
|
123
|
+
[self returnError:errorString];
|
|
124
|
+
} else {
|
|
125
|
+
[self returnSuccess:exportPath];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
106
130
|
- (void)initView:(NSString *)scanMode {
|
|
107
131
|
NSData *data = [self.config dataUsingEncoding:NSUTF8StringEncoding];
|
|
108
132
|
if (!data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "anyline-ocr-react-native-module@^
|
|
3
|
-
"_id": "anyline-ocr-react-native-module@^
|
|
2
|
+
"_from": "anyline-ocr-react-native-module@^51.1.1",
|
|
3
|
+
"_id": "anyline-ocr-react-native-module@^51.1.1",
|
|
4
4
|
"_inBundle": false,
|
|
5
5
|
"_integrity": "sha512-BGi9zNkSsoxXywDBIqzgBRvKUBniQOJHDKBrozZubKthZNRBAj8Ry5tW0Me0yLXt/fauME//hbC0wsenfPJZqw==",
|
|
6
6
|
"_location": "/anyline-ocr-react-native-module",
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "range",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "anyline-ocr-react-native-module@^
|
|
11
|
+
"raw": "anyline-ocr-react-native-module@^51.1.1",
|
|
12
12
|
"name": "anyline-ocr-react-native-module",
|
|
13
13
|
"escapedName": "anyline-ocr-react-native-module",
|
|
14
|
-
"rawSpec": "^
|
|
14
|
+
"rawSpec": "^51.1.1",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^
|
|
16
|
+
"fetchSpec": "^51.1.1"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/"
|
|
20
20
|
],
|
|
21
21
|
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-44.1.2.tgz",
|
|
22
22
|
"_shasum": "bacbcd260cc662244f59393ed81a6edba009b52c",
|
|
23
|
-
"_spec": "anyline-ocr-react-native-module@^
|
|
23
|
+
"_spec": "anyline-ocr-react-native-module@^51.1.1",
|
|
24
24
|
"_where": "/Users/amiransari/Projects/anyline-ocr-react-native-module1/example/RNExampleApp",
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/Anyline/anyline-ocr-react-native-module/issues"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"type": "git",
|
|
48
48
|
"url": "git+https://github.com/Anyline/anyline-ocr-react-native-module.git"
|
|
49
49
|
},
|
|
50
|
-
"version": "
|
|
50
|
+
"version": "51.1.1"
|
|
51
51
|
}
|