@@ -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' ;
2424import Button from '../core/Button' ;
2525import Title from '../core/Title' ;
2626import Option from '../core/Option' ;
@@ -34,7 +34,7 @@ import { createTempFile } from '../../utils/Files';
3434import sampleImage from '../../assets/sampleImage' ;
3535
3636const 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