@sodyo/react-native-sodyo-sdk 3.3.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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  [SodyoSDK for iOS](https://github.com/sodyo-ltd/SodyoSDKPod) v3.54.28
5
5
 
6
- [SodyoSDK for Android](https://search.maven.org/search?q=a:sodyo-android-sdk) v3.54.35
6
+ [SodyoSDK for Android](https://search.maven.org/search?q=a:sodyo-android-sdk) v3.54.39
7
7
 
8
8
 
9
9
  ## Install
@@ -55,7 +55,7 @@ repositories {
55
55
 
56
56
  dependencies {
57
57
  implementation ('com.facebook.react:react-native:+')
58
- implementation ('com.sodyo:sodyo-android-sdk:3.54.35') {
58
+ implementation ('com.sodyo:sodyo-android-sdk:3.54.39') {
59
59
  transitive = true
60
60
  exclude group: 'com.parse.bolts', module: 'bolts-android'
61
61
  }
@@ -271,6 +271,13 @@ public class RNSodyoSdkModule extends ReactContextBaseJavaModule {
271
271
  Sodyo.performMarker(markerId, activity);
272
272
  }
273
273
 
274
+ @ReactMethod
275
+ public void startTroubleshoot() {
276
+ Log.i(TAG, "startTroubleshoot()");
277
+ Activity activity = getCurrentActivity();
278
+ Sodyo.startTroubleshoot(activity);
279
+ }
280
+
274
281
  @ReactMethod
275
282
  public void setSodyoLogoVisible(Boolean isVisible) {
276
283
  Log.i(TAG, "setSodyoLogoVisible()");
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.3.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
@@ -18,12 +18,14 @@ declare const _default: {
18
18
  removeAllListeners (eventType?: string): void
19
19
  onMarkerContent (callback: (markerId: string, data: { [key: string]: any }) => void): () => void,
20
20
  performMarker (markerId: string): void,
21
+ startTroubleshoot (): void,
21
22
  setSodyoLogoVisible (isVisible: boolean): void,
22
23
  setEnv(env: TEnv): void,
23
24
  }
24
25
 
25
26
  interface IScannerProps {
26
27
  isEnabled?: boolean
28
+ isTroubleShootingEnabled?: boolean
27
29
  }
28
30
 
29
31
  export declare class Scanner extends React.PureComponent<IScannerProps> {
package/sodyosdk.js CHANGED
@@ -89,6 +89,10 @@ export default {
89
89
  return RNSodyoSdk.performMarker(markerId);
90
90
  },
91
91
 
92
+ startTroubleshoot: () => {
93
+ return RNSodyoSdk.startTroubleshoot();
94
+ },
95
+
92
96
  start: (successCallback, errorCallback) => {
93
97
  eventEmitter.removeAllListeners('EventMarkerDetectSuccess');
94
98
  eventEmitter.removeAllListeners('EventMarkerDetectError');
@@ -155,21 +159,31 @@ export default {
155
159
  export class Scanner extends Component {
156
160
  static defaultProps = {
157
161
  isEnabled: true,
162
+ isTroubleShootingEnabled: false,
158
163
  };
159
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
+
160
173
  render () {
161
- const { isEnabled, children } = this.props;
174
+ const { isEnabled, isTroubleShootingEnabled, children } = this.props;
162
175
  return (
163
- <Fragment>
164
- <RNSodyoSdkView
165
- isEnabled={isEnabled}
166
- style={{ height: '100%', width: '100%' }}
167
- />
168
-
169
- <View style={styles.container} pointerEvents="box-none">
170
- {children}
171
- </View>
172
- </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>
173
187
  );
174
188
  }
175
189
  }