react-native-scanbot-barcode-scanner-sdk 4.0.2 → 4.0.3-beta.3
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 +1 -1
- package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.mm +10 -11
- package/package.json +2 -2
- package/src/components/barcode-camera-view/scanbot-barcode-camera-view.tsx +2 -2
- package/src/components/barcode-camera-view/scanbot-native-barcode-camera-view.tsx +2 -3
package/Libraries.txt
CHANGED
|
@@ -32,11 +32,10 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
@interface RTNScanbotBarcodeCameraView () <RCTRTNScanbotBarcodeCameraViewViewProtocol>
|
|
35
|
-
@property(nonatomic, strong)
|
|
36
|
-
@property(nonatomic, strong)
|
|
37
|
-
@property(nonatomic
|
|
38
|
-
@property(nonatomic
|
|
39
|
-
@property(nonatomic, strong) BOOL _isFirstLaunch;
|
|
35
|
+
@property(nonatomic, strong) SBSDKBarcodeScannerViewController *viewController;
|
|
36
|
+
@property(nonatomic, strong) SBSDKUIBarcodeFilter *barcodeFilter;
|
|
37
|
+
@property(nonatomic) CGFloat userDefinedCameraZoomFactor;
|
|
38
|
+
@property(nonatomic) BOOL isFirstLaunch;
|
|
40
39
|
@end
|
|
41
40
|
|
|
42
41
|
@implementation RTNScanbotBarcodeCameraView
|
|
@@ -83,7 +82,7 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
83
82
|
parentView:self
|
|
84
83
|
delegate:self];
|
|
85
84
|
|
|
86
|
-
self.
|
|
85
|
+
self.cameraViewController = self.viewController;
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
|
|
@@ -121,7 +120,7 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
121
120
|
return;
|
|
122
121
|
}
|
|
123
122
|
|
|
124
|
-
if (self.
|
|
123
|
+
if (self.barcodeFilter != nil) {
|
|
125
124
|
results = filterBarcodeResults(results, _barcodeFilter);
|
|
126
125
|
}
|
|
127
126
|
|
|
@@ -286,7 +285,7 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
286
285
|
if (forceUpdate || oldViewProps.configuration.cameraZoomFactor != newViewProps.configuration.cameraZoomFactor) {
|
|
287
286
|
if (!isUndefined(newViewProps.configuration.cameraZoomFactor)) {
|
|
288
287
|
if (newViewProps.configuration.cameraZoomFactor != _userDefinedCameraZoomFactor || _userDefinedCameraZoomFactor == -1) {
|
|
289
|
-
viewController.cameraZoomFactor = newViewProps.configuration.cameraZoomFactor;
|
|
288
|
+
self.viewController.cameraZoomFactor = newViewProps.configuration.cameraZoomFactor;
|
|
290
289
|
_userDefinedCameraZoomFactor = newViewProps.configuration.cameraZoomFactor;
|
|
291
290
|
}
|
|
292
291
|
}
|
|
@@ -300,7 +299,7 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
300
299
|
- (void)updateProps:(const facebook::react::Props::Shared &)props oldProps:(const facebook::react::Props::Shared &)oldProps {
|
|
301
300
|
const auto &newViewProps = *std::static_pointer_cast<RTNScanbotBarcodeCameraViewProps const>(props);
|
|
302
301
|
|
|
303
|
-
self.
|
|
302
|
+
self.configuration = newViewProps.configuration;
|
|
304
303
|
|
|
305
304
|
[self applyProps:props oldProps:oldProps forceUpdate:_isFirstLaunch];
|
|
306
305
|
_isFirstLaunch = false;
|
|
@@ -314,8 +313,8 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
314
313
|
}
|
|
315
314
|
- (void)componentDidUpdate {}
|
|
316
315
|
- (void)componentWillUnmount {
|
|
317
|
-
[self.
|
|
318
|
-
self.
|
|
316
|
+
[self.cameraViewController removeFromParentViewController];
|
|
317
|
+
self.cameraViewController = NULL;
|
|
319
318
|
}
|
|
320
319
|
- (void)orientationChanged {}
|
|
321
320
|
|
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.
|
|
4
|
+
"version": "4.0.3-beta.3",
|
|
5
5
|
"scanbot": {
|
|
6
6
|
"iosVersion": "4.0.2"
|
|
7
7
|
},
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"author": "Scanbot SDK GmbH",
|
|
51
51
|
"license": "Commercial",
|
|
52
52
|
"readmeFilename": "README.md",
|
|
53
|
-
"homepage": "https://scanbot.io",
|
|
53
|
+
"homepage": "https://scanbot.io/developer/react-native-barcode-scanner",
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": ">=16.8.1",
|
|
56
56
|
"react-native": ">=0.60 <1.0.x"
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { EmitterSubscription, findNodeHandle, NativeMethods, Platform, UIManager } from 'react-native';
|
|
3
3
|
import { Dimensions } from 'react-native';
|
|
4
4
|
import { ScanbotBarcodeCameraNativeViewProperties, ScanbotBarcodeCameraViewConfiguration, ScanbotBarcodeCameraViewProperties } from './scanbot-barcode-camera-view-types';
|
|
5
|
-
import ScanbotNativeBarcodeCameraView, {
|
|
5
|
+
import ScanbotNativeBarcodeCameraView, { BarcodeCameraViewNativeCommands } from './scanbot-native-barcode-camera-view';
|
|
6
6
|
import { BarcodeResult } from '../../result';
|
|
7
7
|
|
|
8
8
|
const Device = {
|
|
@@ -254,7 +254,7 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
|
|
|
254
254
|
sendCommandToViewId = (viewId: number, command: string, args: any = []) => {
|
|
255
255
|
const cameraView = this.cameraViewReference?.current;
|
|
256
256
|
if (cameraView) {
|
|
257
|
-
|
|
257
|
+
BarcodeCameraViewNativeCommands[command](cameraView);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
}
|
|
@@ -2,7 +2,6 @@ import { HostComponent } from "react-native";
|
|
|
2
2
|
import { ScanbotBarcodeCameraNativeViewProperties } from "./scanbot-barcode-camera-view-types";
|
|
3
3
|
|
|
4
4
|
const nativeBarcodeCameraView = require('../../../js/RTNScanbotBarcodeCameraViewNativeComponent').default;
|
|
5
|
-
const
|
|
5
|
+
export const BarcodeCameraViewNativeCommands = require('../../../js/RTNScanbotBarcodeCameraViewNativeComponent').Commands;
|
|
6
6
|
|
|
7
|
-
export default (nativeBarcodeCameraView as HostComponent<ScanbotBarcodeCameraNativeViewProperties>);
|
|
8
|
-
export const Commands = nativeBarcodeCameraViewCommands;
|
|
7
|
+
export default (nativeBarcodeCameraView as HostComponent<ScanbotBarcodeCameraNativeViewProperties>);
|