@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 +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/sodyo/RNSodyoSdk/RNSodyoSdkModule.java +7 -0
- package/ios/RNSodyoSdk.m +7 -0
- package/ios/RNSodyoSdkManager.m +14 -0
- package/package.json +1 -1
- package/sodyosdk.d.ts +2 -0
- package/sodyosdk.js +25 -11
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.
|
|
6
|
+
[SodyoSDK for Android](https://search.maven.org/search?q=a:sodyo-android-sdk) v3.54.39
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
## Install
|
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
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");
|
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
|
@@ -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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
</
|
|
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
|
}
|