anyline-ocr-react-native-module 55.5.0 → 55.7.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.
package/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 = 'ios/**/*.{h,m,swift}'
|
|
21
|
-
s.dependency "Anyline", "55.
|
|
21
|
+
s.dependency "Anyline", "55.7.0"
|
|
22
22
|
s.dependency "React"
|
|
23
23
|
|
|
24
24
|
end
|
package/android/build.gradle
CHANGED
|
@@ -59,6 +59,8 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule
|
|
|
59
59
|
&& license.equals(requestedLicense));
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
private static String scanViewConfigPathString = null;
|
|
63
|
+
|
|
62
64
|
public static final String REACT_CLASS = "AnylineSDKPlugin";
|
|
63
65
|
private static final String E_ERROR = "E_ERROR";
|
|
64
66
|
|
|
@@ -99,6 +101,11 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule
|
|
|
99
101
|
WrapperSessionProvider.setupWrapperSession(wrapperInfo,this);
|
|
100
102
|
}
|
|
101
103
|
|
|
104
|
+
@ReactMethod
|
|
105
|
+
public void setViewConfigsPath(final String path) {
|
|
106
|
+
scanViewConfigPathString = path;
|
|
107
|
+
}
|
|
108
|
+
|
|
102
109
|
@ReactMethod
|
|
103
110
|
public void licenseKeyExpiryDate(final Promise promise) {
|
|
104
111
|
if (WrapperSessionProvider.getCurrentSdkInitializationResponse().getInitialized() == Boolean.TRUE) {
|
|
@@ -124,7 +131,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule
|
|
|
124
131
|
scanResponseErrorCallback = onErrorReact;
|
|
125
132
|
this.returnMethod = "callback";
|
|
126
133
|
|
|
127
|
-
routeScanMode(config, null,
|
|
134
|
+
routeScanMode(config, null, scanViewConfigPathString, null);
|
|
128
135
|
}
|
|
129
136
|
|
|
130
137
|
@ReactMethod
|
|
@@ -171,7 +178,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule
|
|
|
171
178
|
scanResponseErrorCallback = onErrorReact;
|
|
172
179
|
this.returnMethod = "callback";
|
|
173
180
|
|
|
174
|
-
routeScanMode(config, scanViewInitializationParametersString,
|
|
181
|
+
routeScanMode(config, scanViewInitializationParametersString, scanViewConfigPathString, null);
|
|
175
182
|
}
|
|
176
183
|
@ReactMethod
|
|
177
184
|
public void setupPromise(String config, String scanMode, final Promise promise) {
|
|
@@ -190,7 +197,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule
|
|
|
190
197
|
this.wrapperSessionScanResponsePromise = promise;
|
|
191
198
|
this.returnMethod = "promise";
|
|
192
199
|
|
|
193
|
-
routeScanMode(config, initializationParametersString,
|
|
200
|
+
routeScanMode(config, initializationParametersString, scanViewConfigPathString, scanCallbackConfigString);
|
|
194
201
|
}
|
|
195
202
|
|
|
196
203
|
private void routeScanMode(
|
package/ios/AnylineSDKPlugin.m
CHANGED
|
@@ -9,6 +9,8 @@ static ALWrapperSessionProvider *_wrapperSessionProvider;
|
|
|
9
9
|
// We're creating a static variable to store the last license used to initialize the SDK
|
|
10
10
|
static NSString *license;
|
|
11
11
|
|
|
12
|
+
static NSString *scanViewConfigPathString;
|
|
13
|
+
|
|
12
14
|
@interface AnylineSDKPlugin()
|
|
13
15
|
|
|
14
16
|
@property (nonatomic, copy) NSString *callbackId;
|
|
@@ -54,7 +56,7 @@ static NSString *license;
|
|
|
54
56
|
+ (BOOL)isInitializedWithLicenseKey:(NSString *)requestedLicense {
|
|
55
57
|
ALWrapperSessionSDKInitializationResponse *currentSdkInitializationResponse = [ALWrapperSessionProvider getCurrentSdkInitializationResponse];
|
|
56
58
|
return (license
|
|
57
|
-
&& currentSdkInitializationResponse.initialized
|
|
59
|
+
&& [currentSdkInitializationResponse.initialized isEqualToNumber:@YES]
|
|
58
60
|
&& [license isEqualToString:requestedLicense]);
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -72,6 +74,10 @@ RCT_EXPORT_METHOD(setupWrapperSession:(NSString *)pluginVersion) {
|
|
|
72
74
|
[self setupWrapperSessionWithPluginVersion:pluginVersion];
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
RCT_EXPORT_METHOD(setViewConfigsPath:(NSString *)path) {
|
|
78
|
+
scanViewConfigPathString = path;
|
|
79
|
+
}
|
|
80
|
+
|
|
75
81
|
RCT_EXPORT_METHOD(setupAnylineSDK:(NSString *)licenseKey
|
|
76
82
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
77
83
|
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
@@ -92,13 +98,13 @@ RCT_EXPORT_METHOD(setupAnylineSDKWithCacheConfig:(NSString *)licenseKey
|
|
|
92
98
|
|
|
93
99
|
RCT_EXPORT_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
94
100
|
ALWrapperSessionSDKInitializationResponse *currentSdkInitializationResponse = [ALWrapperSessionProvider getCurrentSdkInitializationResponse];
|
|
95
|
-
BOOL isInitialized = (currentSdkInitializationResponse.initialized
|
|
101
|
+
BOOL isInitialized = ([currentSdkInitializationResponse.initialized isEqualToNumber:@YES]);
|
|
96
102
|
resolve(@(isInitialized));
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
RCT_EXPORT_METHOD(licenseKeyExpiryDate:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
100
106
|
ALWrapperSessionSDKInitializationResponse *currentSdkInitializationResponse = [ALWrapperSessionProvider getCurrentSdkInitializationResponse];
|
|
101
|
-
if (currentSdkInitializationResponse.initialized
|
|
107
|
+
if ([currentSdkInitializationResponse.initialized isEqualToNumber:@YES]) {
|
|
102
108
|
ALWrapperSessionSDKInitializationResponseInitialized *sdkInitializationResponseInitialized = currentSdkInitializationResponse.succeedInfo;
|
|
103
109
|
if (sdkInitializationResponseInitialized) {
|
|
104
110
|
resolve(sdkInitializationResponseInitialized.expiryDate);
|
|
@@ -126,7 +132,7 @@ RCT_EXPORT_METHOD(setupWithInitializationParameters:(NSString * _Nullable)initia
|
|
|
126
132
|
|
|
127
133
|
[self requestScanStartWithScanViewConfigContent:config
|
|
128
134
|
scanViewInitializationParametersString:initializationParametersStr
|
|
129
|
-
scanViewConfigPath:
|
|
135
|
+
scanViewConfigPath:scanViewConfigPathString
|
|
130
136
|
scanCallbackConfigString:nil];
|
|
131
137
|
}
|
|
132
138
|
|
|
@@ -171,7 +177,7 @@ RCT_EXPORT_METHOD(setupPromiseWithInitializationParametersAndScanCallbackConfig:
|
|
|
171
177
|
self.returnMethod = @"promise";
|
|
172
178
|
[self requestScanStartWithScanViewConfigContent:configStr
|
|
173
179
|
scanViewInitializationParametersString:initializationParametersStr
|
|
174
|
-
scanViewConfigPath:
|
|
180
|
+
scanViewConfigPath:scanViewConfigPathString
|
|
175
181
|
scanCallbackConfigString:scanCallbackConfigString];
|
|
176
182
|
}
|
|
177
183
|
|
|
@@ -331,7 +337,7 @@ RCT_EXPORT_METHOD(exportCachedEvents:(RCTPromiseResolveBlock)resolve rejecter:(R
|
|
|
331
337
|
}
|
|
332
338
|
|
|
333
339
|
- (void)onSdkInitializationResponse:(nonnull ALWrapperSessionSDKInitializationResponse *)initializationResponse {
|
|
334
|
-
if (initializationResponse.initialized) {
|
|
340
|
+
if ([initializationResponse.initialized isEqualToNumber:@YES]) {
|
|
335
341
|
self.wrapperSessionSdkInitializationResponsePromiseResolve(@"success");
|
|
336
342
|
} else {
|
|
337
343
|
self.wrapperSessionSdkInitializationResponsePromiseReject(@"ANYLINE_ERROR", [[initializationResponse toJSONDictionary] asJSONString], nil);
|