react-native-scanbot-barcode-scanner-sdk 4.0.1-beta.1 → 4.0.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/Libraries.txt CHANGED
@@ -1,8 +1,8 @@
1
- Open Source libraries used in the Scanbot Barcode SDK for React Native version 4.0.0
1
+ Open Source libraries used in the Scanbot Barcode SDK for React Native version 4.0.1
2
2
 
3
3
  ```text
4
4
 
5
- Open Source libraries used in ScanbotBarcodeScannerSDK for iOS version 4.0.0:
5
+ Open Source libraries used in ScanbotBarcodeScannerSDK for iOS version 4.0.1:
6
6
 
7
7
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8
8
 
@@ -2530,7 +2530,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
2530
2530
 
2531
2531
  ------------------------------------------------------------------------------------------------------------------------
2532
2532
 
2533
- Open Source libraries used in the Scanbot Barcode Scanner SDK for Android version 4.0.0
2533
+ Open Source libraries used in the Scanbot Barcode Scanner SDK for Android version 4.0.1
2534
2534
 
2535
2535
  CWAC-Camera
2536
2536
 
@@ -2781,7 +2781,7 @@ record keeping.)
2781
2781
  * are met:
2782
2782
  *
2783
2783
  * 1. Redistributions of source code must retain the above copyright
2784
- * notice, this list of conditions and the following disclaimer.
2784
+ * notice, this list of conditions and the following disclaimer.
2785
2785
  *
2786
2786
  * 2. Redistributions in binary form must reproduce the above copyright
2787
2787
  * notice, this list of conditions and the following disclaimer in
@@ -2836,21 +2836,21 @@ record keeping.)
2836
2836
  * This package is an SSL implementation written
2837
2837
  * by Eric Young (eay@cryptsoft.com).
2838
2838
  * The implementation was written so as to conform with Netscapes SSL.
2839
- *
2839
+ *
2840
2840
  * This library is free for commercial and non-commercial use as long as
2841
2841
  * the following conditions are aheared to. The following conditions
2842
2842
  * apply to all code found in this distribution, be it the RC4, RSA,
2843
2843
  * lhash, DES, etc., code; not just the SSL code. The SSL documentation
2844
2844
  * included with this distribution is covered by the same copyright terms
2845
2845
  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
2846
- *
2846
+ *
2847
2847
  * Copyright remains Eric Young's, and as such any Copyright notices in
2848
2848
  * the code are not to be removed.
2849
2849
  * If this package is used in a product, Eric Young should be given attribution
2850
2850
  * as the author of the parts of the library used.
2851
2851
  * This can be in the form of a textual message at program startup or
2852
2852
  * in documentation (online or textual) provided with the package.
2853
- *
2853
+ *
2854
2854
  * Redistribution and use in source and binary forms, with or without
2855
2855
  * modification, are permitted provided that the following conditions
2856
2856
  * are met:
@@ -2865,10 +2865,10 @@ record keeping.)
2865
2865
  * Eric Young (eay@cryptsoft.com)"
2866
2866
  * The word 'cryptographic' can be left out if the rouines from the library
2867
2867
  * being used are not cryptographic related :-).
2868
- * 4. If you include any Windows specific code (or a derivative thereof) from
2868
+ * 4. If you include any Windows specific code (or a derivative thereof) from
2869
2869
  * the apps directory (application code) you must include an acknowledgement:
2870
2870
  * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
2871
- *
2871
+ *
2872
2872
  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
2873
2873
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2874
2874
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -2880,7 +2880,7 @@ record keeping.)
2880
2880
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2881
2881
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2882
2882
  * SUCH DAMAGE.
2883
- *
2883
+ *
2884
2884
  * The licence and distribution terms for any publically available version or
2885
2885
  * derivative of this code cannot be changed. i.e. this code cannot simply be
2886
2886
  * copied and put under another distribution licence
@@ -3534,7 +3534,7 @@ JSON for Modern C++
3534
3534
  Version v3.11.2
3535
3535
  (https://github.com/nlohmann/json)
3536
3536
 
3537
- MIT License
3537
+ MIT License
3538
3538
 
3539
3539
  Copyright (c) 2013-2022 Niels Lohmann
3540
3540
 
@@ -3886,7 +3886,7 @@ Version 4.2.0
3886
3886
  Copyright (c) 1988-1997 Sam Leffler
3887
3887
  Copyright (c) 1991-1997 Silicon Graphics, Inc.
3888
3888
 
3889
- Permission to use, copy, modify, distribute, and sell this software and
3889
+ Permission to use, copy, modify, distribute, and sell this software and
3890
3890
  its documentation for any purpose is hereby granted without fee, provided
3891
3891
  that (i) the above copyright notices and this permission notice appear in
3892
3892
  all copies of the software and related documentation, and (ii) the names of
@@ -3894,15 +3894,15 @@ Sam Leffler and Silicon Graphics may not be used in any advertising or
3894
3894
  publicity relating to the software without the specific, prior written
3895
3895
  permission of Sam Leffler and Silicon Graphics.
3896
3896
 
3897
- THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
3898
- EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
3899
- WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
3897
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
3898
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
3899
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
3900
3900
 
3901
3901
  IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
3902
3902
  ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
3903
3903
  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
3904
- WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
3905
- LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
3904
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
3905
+ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
3906
3906
  OF THIS SOFTWARE.
3907
3907
 
3908
3908
 
@@ -4203,7 +4203,7 @@ Version 1.1.0h
4203
4203
  * are met:
4204
4204
  *
4205
4205
  * 1. Redistributions of source code must retain the above copyright
4206
- * notice, this list of conditions and the following disclaimer.
4206
+ * notice, this list of conditions and the following disclaimer.
4207
4207
  *
4208
4208
  * 2. Redistributions in binary form must reproduce the above copyright
4209
4209
  * notice, this list of conditions and the following disclaimer in
@@ -4258,21 +4258,21 @@ Version 1.1.0h
4258
4258
  * This package is an SSL implementation written
4259
4259
  * by Eric Young (eay@cryptsoft.com).
4260
4260
  * The implementation was written so as to conform with Netscapes SSL.
4261
- *
4261
+ *
4262
4262
  * This library is free for commercial and non-commercial use as long as
4263
4263
  * the following conditions are aheared to. The following conditions
4264
4264
  * apply to all code found in this distribution, be it the RC4, RSA,
4265
4265
  * lhash, DES, etc., code; not just the SSL code. The SSL documentation
4266
4266
  * included with this distribution is covered by the same copyright terms
4267
4267
  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
4268
- *
4268
+ *
4269
4269
  * Copyright remains Eric Young's, and as such any Copyright notices in
4270
4270
  * the code are not to be removed.
4271
4271
  * If this package is used in a product, Eric Young should be given attribution
4272
4272
  * as the author of the parts of the library used.
4273
4273
  * This can be in the form of a textual message at program startup or
4274
4274
  * in documentation (online or textual) provided with the package.
4275
- *
4275
+ *
4276
4276
  * Redistribution and use in source and binary forms, with or without
4277
4277
  * modification, are permitted provided that the following conditions
4278
4278
  * are met:
@@ -4287,10 +4287,10 @@ Version 1.1.0h
4287
4287
  * Eric Young (eay@cryptsoft.com)"
4288
4288
  * The word 'cryptographic' can be left out if the rouines from the library
4289
4289
  * being used are not cryptographic related :-).
4290
- * 4. If you include any Windows specific code (or a derivative thereof) from
4290
+ * 4. If you include any Windows specific code (or a derivative thereof) from
4291
4291
  * the apps directory (application code) you must include an acknowledgement:
4292
4292
  * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
4293
- *
4293
+ *
4294
4294
  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
4295
4295
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4296
4296
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -4302,7 +4302,7 @@ Version 1.1.0h
4302
4302
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
4303
4303
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4304
4304
  * SUCH DAMAGE.
4305
- *
4305
+ *
4306
4306
  * The licence and distribution terms for any publically available version or
4307
4307
  * derivative of this code cannot be changed. i.e. this code cannot simply be
4308
4308
  * copied and put under another distribution licence
@@ -4358,7 +4358,7 @@ Version v1.9.2
4358
4358
 
4359
4359
  The MIT License (MIT)
4360
4360
 
4361
- Copyright (c) 2016 Gabi Melman.
4361
+ Copyright (c) 2016 Gabi Melman.
4362
4362
 
4363
4363
  Permission is hereby granted, free of charge, to any person obtaining a copy
4364
4364
  of this software and associated documentation files (the "Software"), to deal
@@ -5216,4 +5216,4 @@ Version 1.1.0
5216
5216
  See the License for the specific language governing permissions and
5217
5217
  limitations under the License.
5218
5218
 
5219
- ```
5219
+ ```
@@ -32,15 +32,14 @@ static inline bool isUndefined(facebook::react::Float value) {
32
32
  }
33
33
 
34
34
  @interface RTNScanbotBarcodeCameraView () <RCTRTNScanbotBarcodeCameraViewViewProtocol>
35
+ @property(nonatomic, strong) RTNScanbotBarcodeCameraViewConfigurationStruct _configuration;
36
+ @property(nonatomic, strong) SBSDKBarcodeScannerViewController* viewController;
37
+ @property(nonatomic, strong) SBSDKUIBarcodeFilter* _barcodeFilter;
38
+ @property(nonatomic, strong) CGFloat _userDefinedCameraZoomFactor;
39
+ @property(nonatomic, strong) BOOL _isFirstLaunch;
35
40
  @end
36
41
 
37
- @implementation RTNScanbotBarcodeCameraView {
38
- RTNScanbotBarcodeCameraViewConfigurationStruct _configuration;
39
- SBSDKBarcodeScannerViewController* viewController;
40
- SBSDKUIBarcodeFilter* _barcodeFilter;
41
- CGFloat _userDefinedCameraZoomFactor;
42
- BOOL _isFirstLaunch;
43
- }
42
+ @implementation RTNScanbotBarcodeCameraView
44
43
 
45
44
  + (ComponentDescriptorProvider)componentDescriptorProvider
46
45
  {
@@ -80,11 +79,11 @@ static inline bool isUndefined(facebook::react::Float value) {
80
79
  }
81
80
 
82
81
  if (!_cameraViewController) {
83
- viewController = [[SBSDKBarcodeScannerViewController alloc] initWithParentViewController:parentViewController
82
+ self.viewController = [[SBSDKBarcodeScannerViewController alloc] initWithParentViewController:parentViewController
84
83
  parentView:self
85
84
  delegate:self];
86
85
 
87
- _cameraViewController = viewController;
86
+ self._cameraViewController = viewController;
88
87
  }
89
88
  }
90
89
 
@@ -122,7 +121,7 @@ static inline bool isUndefined(facebook::react::Float value) {
122
121
  return;
123
122
  }
124
123
 
125
- if (_barcodeFilter != nil) {
124
+ if (self._barcodeFilter != nil) {
126
125
  results = filterBarcodeResults(results, _barcodeFilter);
127
126
  }
128
127
 
@@ -145,7 +144,7 @@ static inline bool isUndefined(facebook::react::Float value) {
145
144
  /* TODO: A single property change requires us to create a new ViewFinder configuration */
146
145
  - (SBSDKBaseScannerViewFinderConfiguration*)createViewFinderConfigurationCopy
147
146
  {
148
- SBSDKBaseScannerViewFinderConfiguration* oldConfig = viewController.viewFinderConfiguration;
147
+ SBSDKBaseScannerViewFinderConfiguration* oldConfig = self.viewController.viewFinderConfiguration;
149
148
  SBSDKBaseScannerViewFinderConfiguration* newConfig = [SBSDKBaseScannerViewFinderConfiguration defaultConfiguration];
150
149
 
151
150
  newConfig.viewFinderEnabled = oldConfig.viewFinderEnabled;
@@ -196,7 +195,7 @@ static inline bool isUndefined(facebook::react::Float value) {
196
195
  }
197
196
 
198
197
  if (!isUndefined(newViewProps.configuration.finderBackgroundOpacity)) {
199
- UIColor* bgColor = viewController.viewFinderConfiguration.backgroundColor;
198
+ UIColor* bgColor = self.viewController.viewFinderConfiguration.backgroundColor;
200
199
  viewFinderConfiguration.backgroundColor = [bgColor colorWithAlphaComponent:newViewProps.configuration.finderBackgroundOpacity];
201
200
  }
202
201
 
@@ -220,7 +219,7 @@ static inline bool isUndefined(facebook::react::Float value) {
220
219
  newViewProps.configuration.finderInset.right);
221
220
  }
222
221
 
223
- viewController.viewFinderConfiguration = viewFinderConfiguration;
222
+ self.viewController.viewFinderConfiguration = viewFinderConfiguration;
224
223
  // ---------------------------------------
225
224
  // END OF ViewFinderConfiguration MAPPING
226
225
  // ---------------------------------------
@@ -231,40 +230,40 @@ static inline bool isUndefined(facebook::react::Float value) {
231
230
 
232
231
  if (forceUpdate || oldViewProps.configuration.minimumTextLength != newViewProps.configuration.minimumTextLength) {
233
232
  if (!isUndefined(newViewProps.configuration.minimumTextLength)) {
234
- viewController.additionalDetectionParameters.minimumTextLength = newViewProps.configuration.minimumTextLength;
233
+ self.viewController.additionalDetectionParameters.minimumTextLength = newViewProps.configuration.minimumTextLength;
235
234
  }
236
235
  }
237
236
 
238
237
  if (forceUpdate || oldViewProps.configuration.maximumTextLength != newViewProps.configuration.maximumTextLength) {
239
238
  if (!isUndefined(newViewProps.configuration.maximumTextLength)) {
240
- viewController.additionalDetectionParameters.maximumTextLength = newViewProps.configuration.maximumTextLength;
239
+ self.viewController.additionalDetectionParameters.maximumTextLength = newViewProps.configuration.maximumTextLength;
241
240
  }
242
241
  }
243
242
 
244
243
  if (forceUpdate || oldViewProps.configuration.minimum1DBarcodesQuietZone != newViewProps.configuration.minimum1DBarcodesQuietZone) {
245
244
  if (!isUndefined(newViewProps.configuration.minimum1DBarcodesQuietZone)) {
246
- viewController.additionalDetectionParameters.minimum1DBarcodesQuietZone = newViewProps.configuration.minimum1DBarcodesQuietZone;
245
+ self.viewController.additionalDetectionParameters.minimum1DBarcodesQuietZone = newViewProps.configuration.minimum1DBarcodesQuietZone;
247
246
  }
248
247
  }
249
248
 
250
249
  if (forceUpdate || oldViewProps.configuration.stripCheckDigits != newViewProps.configuration.stripCheckDigits) {
251
- viewController.additionalDetectionParameters.stripCheckDigits = newViewProps.configuration.stripCheckDigits;
250
+ self.viewController.additionalDetectionParameters.stripCheckDigits = newViewProps.configuration.stripCheckDigits;
252
251
  }
253
252
 
254
253
  if (forceUpdate || oldViewProps.configuration.gs1DecodingEnabled != newViewProps.configuration.gs1DecodingEnabled) {
255
- viewController.additionalDetectionParameters.enableGS1Decoding = newViewProps.configuration.gs1DecodingEnabled;
254
+ self.viewController.additionalDetectionParameters.enableGS1Decoding = newViewProps.configuration.gs1DecodingEnabled;
256
255
  }
257
256
 
258
257
  if (forceUpdate || oldViewProps.configuration.msiPlesseyChecksumAlgorithm != newViewProps.configuration.msiPlesseyChecksumAlgorithm) {
259
- viewController.additionalDetectionParameters.msiPlesseyChecksumAlgorithm = extractMsiPlesseyChecksumAlgorithm(toNSString(newViewProps.configuration.msiPlesseyChecksumAlgorithm));
258
+ self.viewController.additionalDetectionParameters.msiPlesseyChecksumAlgorithm = extractMsiPlesseyChecksumAlgorithm(toNSString(newViewProps.configuration.msiPlesseyChecksumAlgorithm));
260
259
  }
261
260
 
262
261
  if (forceUpdate || oldViewProps.configuration.codeDensity != newViewProps.configuration.codeDensity) {
263
- viewController.additionalDetectionParameters.codeDensity = extractBarcodeDensity(toNSString(newViewProps.configuration.codeDensity));
262
+ self.viewController.additionalDetectionParameters.codeDensity = extractBarcodeDensity(toNSString(newViewProps.configuration.codeDensity));
264
263
  }
265
264
 
266
265
  if (forceUpdate || oldViewProps.configuration.flashEnabled != newViewProps.configuration.flashEnabled) {
267
- viewController.flashLightEnabled = newViewProps.configuration.flashEnabled;
266
+ self.viewController.flashLightEnabled = newViewProps.configuration.flashEnabled;
268
267
  }
269
268
 
270
269
  if (forceUpdate || oldViewProps.configuration.barcodeFormats != newViewProps.configuration.barcodeFormats) {
@@ -276,12 +275,12 @@ static inline bool isUndefined(facebook::react::Float value) {
276
275
  [barcodeFormats addObject:type];
277
276
  }
278
277
  }
279
- viewController.acceptedBarcodeTypes = [barcodeFormats copy];
278
+ self.viewController.acceptedBarcodeTypes = [barcodeFormats copy];
280
279
  }
281
280
  }
282
281
 
283
282
  if (forceUpdate || oldViewProps.configuration.engineMode != newViewProps.configuration.engineMode) {
284
- viewController.engineMode = extractEngineMode(toNSString(newViewProps.configuration.engineMode));
283
+ self.viewController.engineMode = extractEngineMode(toNSString(newViewProps.configuration.engineMode));
285
284
  }
286
285
 
287
286
  if (forceUpdate || oldViewProps.configuration.cameraZoomFactor != newViewProps.configuration.cameraZoomFactor) {
@@ -301,7 +300,7 @@ static inline bool isUndefined(facebook::react::Float value) {
301
300
  - (void)updateProps:(const facebook::react::Props::Shared &)props oldProps:(const facebook::react::Props::Shared &)oldProps {
302
301
  const auto &newViewProps = *std::static_pointer_cast<RTNScanbotBarcodeCameraViewProps const>(props);
303
302
 
304
- _configuration = newViewProps.configuration;
303
+ self._configuration = newViewProps.configuration;
305
304
 
306
305
  [self applyProps:props oldProps:oldProps forceUpdate:_isFirstLaunch];
307
306
  _isFirstLaunch = false;
@@ -315,8 +314,8 @@ static inline bool isUndefined(facebook::react::Float value) {
315
314
  }
316
315
  - (void)componentDidUpdate {}
317
316
  - (void)componentWillUnmount {
318
- [_cameraViewController removeFromParentViewController];
319
- _cameraViewController = NULL;
317
+ [self._cameraViewController removeFromParentViewController];
318
+ self._cameraViewController = NULL;
320
319
  }
321
320
  - (void)orientationChanged {}
322
321
 
@@ -15,32 +15,28 @@
15
15
  #import <ScanbotBarcodeScannerSDK/ScanbotBarcodeScannerSDK.h>
16
16
  #import <Foundation/Foundation.h>
17
17
 
18
- @implementation RNScanbotBarcodeCameraView {
19
- SBSDKBarcodeScannerViewController* viewController;
20
- RNScanbotCameraViewConfiguration* _cameraViewConfiguration;
21
- CGFloat _userDefinedCameraZoomFactor;
22
- }
18
+ @interface RNScanbotBarcodeCameraView()
19
+ @property(nonatomic, strong) SBSDKBarcodeScannerViewController* viewController;
20
+ @property(nonatomic, strong) RNScanbotCameraViewConfiguration* mCameraViewConfiguration;
21
+ @property(nonatomic) CGFloat mUserDefinedCameraZoomFactor;
22
+ @end
23
+
24
+ @implementation RNScanbotBarcodeCameraView
23
25
 
24
26
  - (instancetype)initWithFrame:(CGRect)frame {
25
27
  self = [super initWithFrame:frame];
26
- self.barcodes = [[NSMutableArray alloc] init];
27
- self.shouldUseFinderView = false;
28
- _cameraViewConfiguration = [[RNScanbotCameraViewConfiguration alloc] init];
29
- _userDefinedCameraZoomFactor = -1;
28
+ if (self) {
29
+ _barcodes = [[NSMutableArray alloc] init];
30
+ _shouldUseFinderView = false;
31
+ _mCameraViewConfiguration = [[RNScanbotCameraViewConfiguration alloc] init];
32
+ _mUserDefinedCameraZoomFactor = -1;
33
+ }
30
34
  return self;
31
35
  }
32
36
 
33
- - (void)layoutSubviews {
34
- if (_cameraViewController) {
35
- _cameraViewController.view.frame = [self bounds];
36
- return;
37
- }
38
-
39
- __weak RNScanbotBarcodeCameraView* weakSelf = self;
40
-
41
- dispatch_async(dispatch_get_main_queue(), ^{
42
- [weakSelf createCameraViewController];
43
- });
37
+ - (void)didMoveToWindow {
38
+ [super didMoveToWindow];
39
+ [self createCameraViewController];
44
40
  }
45
41
 
46
42
  - (void)createCameraViewController {
@@ -49,14 +45,14 @@
49
45
  return;
50
46
  }
51
47
 
52
- if (!_cameraViewController) {
53
- viewController = [[SBSDKBarcodeScannerViewController alloc] initWithParentViewController:parentViewController
54
- parentView:self
55
- delegate:self];
56
- _cameraViewController = viewController;
48
+ if (!self.cameraViewController) {
49
+ self.viewController = [[SBSDKBarcodeScannerViewController alloc] initWithParentViewController:parentViewController
50
+ parentView:self
51
+ delegate:self];
52
+ self.cameraViewController = self.viewController;
53
+
54
+ [self updateWithConfiguration];
57
55
  }
58
-
59
- [self updateWithConfiguration];
60
56
  }
61
57
 
62
58
  - (void)setConfiguration:(NSDictionary *)configuration {
@@ -96,9 +92,9 @@
96
92
  return;
97
93
  }
98
94
 
99
- _cameraViewConfiguration = cameraViewConfiguration;
95
+ self.mCameraViewConfiguration = cameraViewConfiguration;
100
96
 
101
- if(viewController) {
97
+ if(self.viewController) {
102
98
  [self updateWithConfiguration];
103
99
  }
104
100
  }
@@ -106,62 +102,65 @@
106
102
  - (void)updateWithConfiguration {
107
103
 
108
104
  SBSDKBaseScannerViewFinderConfiguration *configuration = [[SBSDKBaseScannerViewFinderConfiguration alloc] init];
109
- configuration.lineWidth = _cameraViewConfiguration.finderLineWidth;
110
- configuration.lineColor = _cameraViewConfiguration.finderLineColor;
111
- configuration.backgroundColor = _cameraViewConfiguration.finderBackgroundColor;
112
- configuration.backgroundColor = [configuration.backgroundColor colorWithAlphaComponent:_cameraViewConfiguration.finderBackgroundOpacity];
113
- configuration.aspectRatio = _cameraViewConfiguration.finderAspectRatio;
105
+ configuration.lineWidth = self.mCameraViewConfiguration.finderLineWidth;
106
+ configuration.lineColor = self.mCameraViewConfiguration.finderLineColor;
107
+ configuration.backgroundColor = self.mCameraViewConfiguration.finderBackgroundColor;
108
+ configuration.backgroundColor = [configuration.backgroundColor colorWithAlphaComponent:self.mCameraViewConfiguration.finderBackgroundOpacity];
109
+ configuration.aspectRatio = self.mCameraViewConfiguration.finderAspectRatio;
114
110
  if (self.finderInsetAvailable) {
115
- configuration.minimumInset = UIEdgeInsetsMake(_cameraViewConfiguration.finderInset.top,
116
- _cameraViewConfiguration.finderInset.left,
117
- _cameraViewConfiguration.finderInset.bottom,
118
- _cameraViewConfiguration.finderInset.right);
111
+ configuration.minimumInset = UIEdgeInsetsMake(self.mCameraViewConfiguration.finderInset.top,
112
+ self.mCameraViewConfiguration.finderInset.left,
113
+ self.mCameraViewConfiguration.finderInset.bottom,
114
+ self.mCameraViewConfiguration.finderInset.right);
119
115
  }
120
116
  configuration.viewFinderEnabled = self.shouldUseFinderView;
121
- viewController.viewFinderConfiguration = configuration;
122
- if (_cameraViewConfiguration.barcodeFormats) {
123
- viewController.acceptedBarcodeTypes = _cameraViewConfiguration.barcodeFormats;
117
+ self.viewController.viewFinderConfiguration = configuration;
118
+ if (self.mCameraViewConfiguration.barcodeFormats) {
119
+ self.viewController.acceptedBarcodeTypes = self.mCameraViewConfiguration.barcodeFormats;
124
120
  }
125
- if (_cameraViewConfiguration.acceptedDocumentFormats) {
126
- viewController.acceptedDocumentTypes = _cameraViewConfiguration.acceptedDocumentFormats;
121
+ if (self.mCameraViewConfiguration.acceptedDocumentFormats) {
122
+ self.viewController.acceptedDocumentTypes = self.mCameraViewConfiguration.acceptedDocumentFormats;
127
123
  }
128
124
 
129
125
  // Map Additional Parameters
130
126
  SBSDKBarcodeAdditionalParameters* additionalParameters = [[SBSDKBarcodeAdditionalParameters alloc] init];
131
127
 
132
- if (_cameraViewConfiguration.gs1DecodingEnabled) {
133
- additionalParameters.enableGS1Decoding = [_cameraViewConfiguration.gs1DecodingEnabled boolValue];
128
+ if (self.mCameraViewConfiguration.gs1DecodingEnabled) {
129
+ additionalParameters.enableGS1Decoding = [self.mCameraViewConfiguration.gs1DecodingEnabled boolValue];
134
130
  }
135
- if (_cameraViewConfiguration.maximumTextLength) {
136
- additionalParameters.maximumTextLength = [_cameraViewConfiguration.maximumTextLength intValue];
131
+ if (self.mCameraViewConfiguration.maximumTextLength) {
132
+ additionalParameters.maximumTextLength = [self.mCameraViewConfiguration.maximumTextLength intValue];
137
133
  }
138
- if (_cameraViewConfiguration.minimumTextLength) {
139
- additionalParameters.minimumTextLength = [_cameraViewConfiguration.minimumTextLength intValue];
134
+ if (self.mCameraViewConfiguration.minimumTextLength) {
135
+ additionalParameters.minimumTextLength = [self.mCameraViewConfiguration.minimumTextLength intValue];
140
136
  }
141
- if (_cameraViewConfiguration.msiPlesseyChecksumAlgorithm != -1) {
142
- additionalParameters.msiPlesseyChecksumAlgorithm = _cameraViewConfiguration.msiPlesseyChecksumAlgorithm;
137
+ if (self.mCameraViewConfiguration.msiPlesseyChecksumAlgorithm != -1) {
138
+ additionalParameters.msiPlesseyChecksumAlgorithm = self.mCameraViewConfiguration.msiPlesseyChecksumAlgorithm;
143
139
  }
144
- if (_cameraViewConfiguration.stripCheckDigits) {
145
- additionalParameters.stripCheckDigits = [_cameraViewConfiguration.stripCheckDigits boolValue];
140
+ if (self.mCameraViewConfiguration.stripCheckDigits) {
141
+ additionalParameters.stripCheckDigits = [self.mCameraViewConfiguration.stripCheckDigits boolValue];
146
142
  }
147
- if (_cameraViewConfiguration.codeDensity) {
148
- additionalParameters.codeDensity = _cameraViewConfiguration.codeDensity;
143
+ if (self.mCameraViewConfiguration.codeDensity) {
144
+ additionalParameters.codeDensity = self.mCameraViewConfiguration.codeDensity;
149
145
  }
150
146
 
151
- viewController.additionalDetectionParameters = additionalParameters;
147
+ self.viewController.additionalDetectionParameters = additionalParameters;
152
148
 
153
- if (_cameraViewConfiguration.cameraZoomFactor) {
154
- CGFloat value = [_cameraViewConfiguration.cameraZoomFactor floatValue];
155
- if (value != _userDefinedCameraZoomFactor || _userDefinedCameraZoomFactor == -1) {
156
- viewController.cameraZoomFactor = value;
157
- _userDefinedCameraZoomFactor = value;
149
+ if (self.mCameraViewConfiguration.cameraZoomFactor) {
150
+ CGFloat value = [self.mCameraViewConfiguration.cameraZoomFactor floatValue];
151
+ if (value != self.mUserDefinedCameraZoomFactor || self.mUserDefinedCameraZoomFactor == -1) {
152
+ self.viewController.cameraZoomFactor = value;
153
+ self.mUserDefinedCameraZoomFactor = value;
158
154
  }
159
155
  }
160
- if (_cameraViewConfiguration.engineMode != -1) {
161
- viewController.engineMode = _cameraViewConfiguration.engineMode;
156
+ if (self.mCameraViewConfiguration.engineMode != -1) {
157
+ self.viewController.engineMode = self.mCameraViewConfiguration.engineMode;
162
158
  }
163
- if (_cameraViewConfiguration.flashEnabled) {
164
- viewController.flashLightEnabled = [_cameraViewConfiguration.flashEnabled boolValue];
159
+
160
+ if (self.mCameraViewConfiguration.flashEnabled) {
161
+ if (self.viewController.flashLightEnabled != [self.mCameraViewConfiguration.flashEnabled boolValue]) {
162
+ self.viewController.flashLightEnabled = [self.mCameraViewConfiguration.flashEnabled boolValue];
163
+ }
165
164
  }
166
165
  }
167
166
 
@@ -204,8 +203,8 @@
204
203
  return;
205
204
  }
206
205
 
207
- if (_cameraViewConfiguration.barcodeFilter != nil) {
208
- results = filterBarcodeResults(results, _cameraViewConfiguration.barcodeFilter);
206
+ if (self.mCameraViewConfiguration.barcodeFilter != nil) {
207
+ results = filterBarcodeResults(results, self.mCameraViewConfiguration.barcodeFilter);
209
208
  }
210
209
 
211
210
  NSDictionary* outResult = @{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-scanbot-barcode-scanner-sdk",
3
3
  "title": "Scanbot Barcode Scanner SDK for React Native",
4
- "version": "4.0.1-beta.1",
4
+ "version": "4.0.1",
5
5
  "scanbot": {
6
6
  "iosVersion": "4.0.2"
7
7
  },