Skip to content

Commit 4a72d29

Browse files
committed
SHK-7710: Enabled react-native-fs and react-native-device-info
1 parent 1777ffd commit 4a72d29

3 files changed

Lines changed: 24 additions & 35 deletions

File tree

android/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ repositories {
7878
google()
7979
}
8080

81-
rootProject.allprojects {
82-
repositories {
83-
mavenCentral()
84-
}
85-
}
86-
8781
def kotlin_version = getExtOrDefault("kotlinVersion")
8882

8983
dependencies {

example/src/ui/core/Version.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { StyleSheet, Text, TouchableWithoutFeedback, View } from 'react-native';
2-
// import DeviceInfo from 'react-native-device-info';
2+
import DeviceInfo from 'react-native-device-info';
33

44
const Version = () => {
55
return (
66
<View style={styles.info}>
77
<TouchableWithoutFeedback>
8-
{/*<Text style={styles.version}>{'v' + DeviceInfo.getVersion()}</Text>*/}
9-
<Text style={styles.version}>{'v1.0.0'}</Text>
8+
<Text style={styles.version}>{'v' + DeviceInfo.getVersion()}</Text>
109
</TouchableWithoutFeedback>
1110
</View>
1211
);

example/src/ui/shake/MainScreen.tsx

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Shake, {
2020
ShakeTheme,
2121
ShakeTitle,
2222
} from '@shakebugs/react-native-shake';
23-
// import RNFS from 'react-native-fs';
23+
import RNFS from 'react-native-fs';
2424
import Button from '../core/Button';
2525
import Title from '../core/Title';
2626
import Option from '../core/Option';
@@ -34,7 +34,7 @@ import { createTempFile } from '../../utils/Files';
3434
import sampleImage from '../../assets/sampleImage';
3535

3636
const MainScreen = () => {
37-
// let path = RNFS.DocumentDirectoryPath + '/file.txt';
37+
let path = RNFS.DocumentDirectoryPath + '/file.txt';
3838

3939
const [shakeInvokingEnabled, setShakeInvokingEnabled] = useState(false);
4040
const [buttonInvokingEnabled, setButtonInvokingEnabled] = useState(false);
@@ -56,14 +56,10 @@ const MainScreen = () => {
5656
//const networkTester = new FetchNetworkTester();
5757
const networkTester = new AxiosNetworkTester();
5858

59-
// useEffect(() => {
60-
// createTempFile(path);
61-
// initialize();
62-
// }, [path]);
63-
64-
useEffect(() => {
65-
initialize();
66-
}, []);
59+
useEffect(() => {
60+
createTempFile(path);
61+
initialize();
62+
}, [path]);
6763

6864
const initialize = () => {
6965
setBlackBoxEnabled(Shake.isEnableBlackBox());
@@ -88,25 +84,25 @@ const MainScreen = () => {
8884
};
8985

9086
const setReportData = () => {
91-
// Shake.setShakeReportData([
92-
// ShakeFile.create(path),
93-
// ShakeFile.create(path, 'customName'),
94-
// ]);
87+
Shake.setShakeReportData([
88+
ShakeFile.create(path),
89+
ShakeFile.create(path, 'customName'),
90+
]);
9591
};
9692

9793
const silentReport = () => {
98-
// const configuration = new ShakeReportConfiguration();
99-
// configuration.blackBoxData = true;
100-
// configuration.activityHistoryData = true;
101-
// configuration.video = true;
102-
// configuration.screenshot = true;
103-
// configuration.showReportSentMessage = false;
104-
//
105-
// Shake.silentReport(
106-
// 'Silent reports are working!',
107-
// [ShakeFile.create(path), ShakeFile.create(path, 'customName')],
108-
// configuration
109-
// );
94+
const configuration = new ShakeReportConfiguration();
95+
configuration.blackBoxData = true;
96+
configuration.activityHistoryData = true;
97+
configuration.video = true;
98+
configuration.screenshot = true;
99+
configuration.showReportSentMessage = false;
100+
101+
Shake.silentReport(
102+
'Silent reports are working!',
103+
[ShakeFile.create(path), ShakeFile.create(path, 'customName')],
104+
configuration
105+
);
110106
};
111107

112108
const addPrivateViewFun = () => {

0 commit comments

Comments
 (0)