@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 +7 -0
- package/ios/RNSodyoSdkManager.m +14 -0
- package/package.json +1 -1
- package/sodyosdk.d.ts +1 -0
- package/sodyosdk.js +21 -11
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");
|
package/ios/RNSodyoSdkManager.m
CHANGED
|
@@ -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
package/sodyosdk.d.ts
CHANGED
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
</
|
|
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
|
}
|