4
4
* @flow
5
5
*/
6
6
7
- import React , { Component } from 'react' ;
7
+ import React , { Component } from 'react' ;
8
8
import {
9
9
Platform ,
10
10
StyleSheet ,
@@ -27,7 +27,9 @@ import Instabug, {
27
27
28
28
const instructions = Platform . select ( {
29
29
ios : 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu' ,
30
- android : 'Double tap R on your keyboard to reload,\n' + 'Shake or press menu button for dev menu' ,
30
+ android :
31
+ 'Double tap R on your keyboard to reload,\n' +
32
+ 'Shake or press menu button for dev menu' ,
31
33
} ) ;
32
34
33
35
export default class App extends Component < { } > {
@@ -38,45 +40,59 @@ export default class App extends Component<{}> {
38
40
colorTheme : 'Light' ,
39
41
} ;
40
42
41
- Instabug . start ( '068ba9a8c3615035e163dc5f829c73be' , [
42
- Instabug . invocationEvent . floatingButton ,
43
- ] ) ;
43
+ Instabug . start ( 'YOUR_TOKEN' , [ Instabug . invocationEvent . floatingButton ] ) ;
44
44
}
45
45
46
46
render ( ) {
47
47
return (
48
48
< View testID = "welcome" style = { styles . container } >
49
49
< ScrollView contentContainerStyle = { styles . contentContainer } >
50
50
< Text style = { styles . details } >
51
- Hello { "Instabug's" } awesome user! The purpose of this application is to show you the
52
- different options for customizing the SDK and how easy it is to integrate it to your
53
- existing app
51
+ Hello { "Instabug's" } awesome user! The purpose of this application
52
+ is to show you the different options for customizing the SDK and how
53
+ easy it is to integrate it to your existing app
54
54
</ Text >
55
55
< TouchableOpacity style = { styles . button } onPress = { ( ) => this . invoke ( ) } >
56
56
< Text style = { styles . text } > INVOKE </ Text >
57
57
</ TouchableOpacity >
58
- < TouchableOpacity style = { styles . button } onPress = { ( ) => this . sendBugReport ( ) } >
58
+ < TouchableOpacity
59
+ style = { styles . button }
60
+ onPress = { ( ) => this . sendBugReport ( ) } >
59
61
< Text style = { styles . text } > SEND BUG REPORT </ Text >
60
62
</ TouchableOpacity >
61
- < TouchableOpacity style = { styles . button } onPress = { ( ) => this . sendFeedback ( ) } >
63
+ < TouchableOpacity
64
+ style = { styles . button }
65
+ onPress = { ( ) => this . sendFeedback ( ) } >
62
66
< Text style = { styles . text } > SEND FEEDBACK </ Text >
63
67
</ TouchableOpacity >
64
- < TouchableOpacity style = { styles . button } onPress = { ( ) => this . startNewConversation ( ) } >
68
+ < TouchableOpacity
69
+ style = { styles . button }
70
+ onPress = { ( ) => this . startNewConversation ( ) } >
65
71
< Text style = { styles . text } > ASK A QUESTION </ Text >
66
72
</ TouchableOpacity >
67
- < TouchableOpacity style = { styles . button } onPress = { ( ) => this . sendCrashReport ( ) } >
73
+ < TouchableOpacity
74
+ style = { styles . button }
75
+ onPress = { ( ) => this . sendCrashReport ( ) } >
68
76
< Text style = { styles . text } > THROW HANDLED EXCEPTION </ Text >
69
77
</ TouchableOpacity >
70
- < TouchableOpacity style = { styles . button } onPress = { ( ) => this . showNpsSurvey ( ) } >
78
+ < TouchableOpacity
79
+ style = { styles . button }
80
+ onPress = { ( ) => this . showNpsSurvey ( ) } >
71
81
< Text style = { styles . text } > SHOW NPS SURVEY </ Text >
72
82
</ TouchableOpacity >
73
- < TouchableOpacity style = { styles . button } onPress = { ( ) => this . showMultipleQuestionSurvey ( ) } >
83
+ < TouchableOpacity
84
+ style = { styles . button }
85
+ onPress = { ( ) => this . showMultipleQuestionSurvey ( ) } >
74
86
< Text style = { styles . text } > SHOW MULTIPLE QUESTION SURVEY </ Text >
75
87
</ TouchableOpacity >
76
- < TouchableOpacity style = { styles . button } onPress = { ( ) => this . showFeatureRequests ( ) } >
88
+ < TouchableOpacity
89
+ style = { styles . button }
90
+ onPress = { ( ) => this . showFeatureRequests ( ) } >
77
91
< Text style = { styles . text } > SHOW FEATURE REQUESTS </ Text >
78
92
</ TouchableOpacity >
79
- < TouchableOpacity style = { styles . button } onPress = { ( ) => this . showUnreadMessagesCount ( ) } >
93
+ < TouchableOpacity
94
+ style = { styles . button }
95
+ onPress = { ( ) => this . showUnreadMessagesCount ( ) } >
80
96
< Text style = { styles . text } > GET UNREAD MESSAGES COUNT </ Text >
81
97
</ TouchableOpacity >
82
98
{ this . invocationEvent ( ) }
@@ -100,8 +116,13 @@ export default class App extends Component<{}> {
100
116
/>
101
117
</ View >
102
118
< View style = { styles . switchView } >
103
- < Text style = { styles . textSwitchStyle } > Color Theme: { this . state . colorTheme } </ Text >
104
- < Switch onValueChange = { this . toggleSwitch } value = { this . state . switchValue } />
119
+ < Text style = { styles . textSwitchStyle } >
120
+ Color Theme: { this . state . colorTheme }
121
+ </ Text >
122
+ < Switch
123
+ onValueChange = { this . toggleSwitch }
124
+ value = { this . state . switchValue }
125
+ />
105
126
</ View >
106
127
</ ScrollView >
107
128
</ View >
@@ -115,32 +136,27 @@ export default class App extends Component<{}> {
115
136
< View style = { styles . rowView } >
116
137
< TouchableOpacity
117
138
style = { styles . buttonColor }
118
- onPress = { ( ) => this . changeInvocationEvent ( 'Shake' ) }
119
- >
139
+ onPress = { ( ) => this . changeInvocationEvent ( 'Shake' ) } >
120
140
< Text style = { styles . textInvoke } > SHAKE </ Text >
121
141
</ TouchableOpacity >
122
142
< TouchableOpacity
123
143
style = { styles . buttonColor }
124
- onPress = { ( ) => this . changeInvocationEvent ( 'Screenshot' ) }
125
- >
144
+ onPress = { ( ) => this . changeInvocationEvent ( 'Screenshot' ) } >
126
145
< Text style = { styles . textInvoke } > SCREENSHOT </ Text >
127
146
</ TouchableOpacity >
128
147
< TouchableOpacity
129
148
style = { styles . buttonColor }
130
- onPress = { ( ) => this . changeInvocationEvent ( 'twoFingersSwipe' ) }
131
- >
149
+ onPress = { ( ) => this . changeInvocationEvent ( 'twoFingersSwipe' ) } >
132
150
< Text style = { styles . textInvoke } > TWO FINGERS SWIPE LEFT</ Text >
133
151
</ TouchableOpacity >
134
152
< TouchableOpacity
135
153
style = { styles . buttonColor }
136
- onPress = { ( ) => this . changeInvocationEvent ( 'Button' ) }
137
- >
154
+ onPress = { ( ) => this . changeInvocationEvent ( 'Button' ) } >
138
155
< Text style = { styles . textInvoke } > FLOATING BUTTON </ Text >
139
156
</ TouchableOpacity >
140
157
< TouchableOpacity
141
158
style = { styles . buttonColor }
142
- onPress = { ( ) => this . changeInvocationEvent ( 'None' ) }
143
- >
159
+ onPress = { ( ) => this . changeInvocationEvent ( 'None' ) } >
144
160
< Text style = { styles . textInvoke } > NONE </ Text >
145
161
</ TouchableOpacity >
146
162
</ View >
@@ -149,12 +165,12 @@ export default class App extends Component<{}> {
149
165
}
150
166
151
167
toggleSwitch = value => {
152
- this . setState ( { switchValue : value } ) ;
168
+ this . setState ( { switchValue : value } ) ;
153
169
if ( value ) {
154
- this . setState ( { colorTheme : 'Light' } ) ;
170
+ this . setState ( { colorTheme : 'Light' } ) ;
155
171
Instabug . setColorTheme ( Instabug . colorTheme . light ) ;
156
172
} else {
157
- this . setState ( { colorTheme : 'Dark' } ) ;
173
+ this . setState ( { colorTheme : 'Dark' } ) ;
158
174
Instabug . setColorTheme ( Instabug . colorTheme . dark ) ;
159
175
}
160
176
} ;
@@ -206,11 +222,17 @@ export default class App extends Component<{}> {
206
222
if ( invocationEvent === 'Shake' )
207
223
BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . shake ] ) ;
208
224
if ( invocationEvent === 'Button' )
209
- BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . floatingButton ] ) ;
225
+ BugReporting . setInvocationEvents ( [
226
+ BugReporting . invocationEvent . floatingButton ,
227
+ ] ) ;
210
228
if ( invocationEvent === 'Screenshot' )
211
- BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . screenshot ] ) ;
229
+ BugReporting . setInvocationEvents ( [
230
+ BugReporting . invocationEvent . screenshot ,
231
+ ] ) ;
212
232
if ( invocationEvent === 'twoFingersSwipe' )
213
- BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . twoFingersSwipe ] ) ;
233
+ BugReporting . setInvocationEvents ( [
234
+ BugReporting . invocationEvent . twoFingersSwipe ,
235
+ ] ) ;
214
236
if ( invocationEvent === 'None' )
215
237
BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . none ] ) ;
216
238
}
@@ -225,7 +247,7 @@ export default class App extends Component<{}> {
225
247
} ) ;
226
248
}
227
249
}
228
- buttonColor = function ( myColor ) {
250
+ buttonColor = function ( myColor ) {
229
251
return {
230
252
marginTop : 10 ,
231
253
padding : 20 ,
0 commit comments