@sodyo/react-native-sodyo-sdk 3.5.0 → 3.5.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/ios/RNSodyoSdk.m CHANGED
@@ -90,6 +90,13 @@ RCT_EXPORT_METHOD(performMarker:(NSString *) markerId)
90
90
  [SodyoSDK performMarker:markerId];
91
91
  }
92
92
 
93
+ RCT_EXPORT_METHOD(startTroubleshoot)
94
+ {
95
+ NSLog(@"startTroubleshoot");
96
+
97
+ [SodyoSDK startTroubleshoot:sodyoScanner];
98
+ }
99
+
93
100
  RCT_EXPORT_METHOD(setSodyoLogoVisible:(BOOL *) isVisible)
94
101
  {
95
102
  NSLog(@"setSodyoLogoVisible");
@@ -40,6 +40,20 @@ RCT_CUSTOM_VIEW_PROPERTY(isEnabled, BOOL, UIView)
40
40
  [SodyoSDK stopScanning:self->sodyoScanner];
41
41
  }
42
42
 
43
+ RCT_CUSTOM_VIEW_PROPERTY(isTroubleShootingEnabled, BOOL, UIView)
44
+ {
45
+ NSLog(@"RNSodyoSdkManager set isTroubleShootingEnabled");
46
+
47
+ if (!self->sodyoScanner) {
48
+ return;
49
+ }
50
+
51
+ if ([RCTConvert BOOL:json]) {
52
+ [SodyoSDK startTroubleshoot:sodyoScanner];
53
+ return;
54
+ }
55
+ }
56
+
43
57
  - (UIView *)view
44
58
  {
45
59
  UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sodyo/react-native-sodyo-sdk",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "RNSodyoSdk",
5
5
  "main": "sodyosdk.js",
6
6
  "typings": "./sodyosdk.d.ts",
package/sodyosdk.d.ts CHANGED
@@ -25,6 +25,7 @@ declare const _default: {
25
25
 
26
26
  interface IScannerProps {
27
27
  isEnabled?: boolean
28
+ isTroubleShootingEnabled?: boolean
28
29
  }
29
30
 
30
31
  export declare class Scanner extends React.PureComponent<IScannerProps> {
package/sodyosdk.js CHANGED
@@ -159,21 +159,31 @@ export default {
159
159
  export class Scanner extends Component {
160
160
  static defaultProps = {
161
161
  isEnabled: true,
162
+ isTroubleShootingEnabled: false,
162
163
  };
163
164
 
165
+ componentDidUpdate(prevProps: Readonly<P>, prevState: Readonly<S>, snapshot: SS) {
166
+ if (this.props.isTroubleShootingEnabled) {
167
+ if (Platform.OS !== 'ios') {
168
+ return RNSodyoSdk.startTroubleshoot()
169
+ }
170
+ }
171
+ }
172
+
164
173
  render () {
165
- const { isEnabled, children } = this.props;
174
+ const { isEnabled, isTroubleShootingEnabled, children } = this.props;
166
175
  return (
167
- <Fragment>
168
- <RNSodyoSdkView
169
- isEnabled={isEnabled}
170
- style={{ height: '100%', width: '100%' }}
171
- />
172
-
173
- <View style={styles.container} pointerEvents="box-none">
174
- {children}
175
- </View>
176
- </Fragment>
176
+ <Fragment>
177
+ <RNSodyoSdkView
178
+ isEnabled={isEnabled}
179
+ isTroubleShootingEnabled={isTroubleShootingEnabled}
180
+ style={{ height: '100%', width: '100%' }}
181
+ />
182
+
183
+ <View style={styles.container} pointerEvents="box-none">
184
+ {children}
185
+ </View>
186
+ </Fragment>
177
187
  );
178
188
  }
179
189
  }