Skip to content

Commit 1b5bf8e

Browse files
added IBG token for iOS test
1 parent 3423412 commit 1b5bf8e

File tree

1 file changed

+57
-35
lines changed

1 file changed

+57
-35
lines changed

InstabugSample/App.js

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @flow
55
*/
66

7-
import React, { Component } from 'react';
7+
import React, {Component} from 'react';
88
import {
99
Platform,
1010
StyleSheet,
@@ -27,7 +27,9 @@ import Instabug, {
2727

2828
const instructions = Platform.select({
2929
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',
3133
});
3234

3335
export default class App extends Component<{}> {
@@ -38,45 +40,59 @@ export default class App extends Component<{}> {
3840
colorTheme: 'Light',
3941
};
4042

41-
Instabug.start('068ba9a8c3615035e163dc5f829c73be', [
42-
Instabug.invocationEvent.floatingButton,
43-
]);
43+
Instabug.start('YOUR_TOKEN', [Instabug.invocationEvent.floatingButton]);
4444
}
4545

4646
render() {
4747
return (
4848
<View testID="welcome" style={styles.container}>
4949
<ScrollView contentContainerStyle={styles.contentContainer}>
5050
<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
5454
</Text>
5555
<TouchableOpacity style={styles.button} onPress={() => this.invoke()}>
5656
<Text style={styles.text}> INVOKE </Text>
5757
</TouchableOpacity>
58-
<TouchableOpacity style={styles.button} onPress={() => this.sendBugReport()}>
58+
<TouchableOpacity
59+
style={styles.button}
60+
onPress={() => this.sendBugReport()}>
5961
<Text style={styles.text}> SEND BUG REPORT </Text>
6062
</TouchableOpacity>
61-
<TouchableOpacity style={styles.button} onPress={() => this.sendFeedback()}>
63+
<TouchableOpacity
64+
style={styles.button}
65+
onPress={() => this.sendFeedback()}>
6266
<Text style={styles.text}> SEND FEEDBACK </Text>
6367
</TouchableOpacity>
64-
<TouchableOpacity style={styles.button} onPress={() => this.startNewConversation()}>
68+
<TouchableOpacity
69+
style={styles.button}
70+
onPress={() => this.startNewConversation()}>
6571
<Text style={styles.text}> ASK A QUESTION </Text>
6672
</TouchableOpacity>
67-
<TouchableOpacity style={styles.button} onPress={() => this.sendCrashReport()}>
73+
<TouchableOpacity
74+
style={styles.button}
75+
onPress={() => this.sendCrashReport()}>
6876
<Text style={styles.text}> THROW HANDLED EXCEPTION </Text>
6977
</TouchableOpacity>
70-
<TouchableOpacity style={styles.button} onPress={() => this.showNpsSurvey()}>
78+
<TouchableOpacity
79+
style={styles.button}
80+
onPress={() => this.showNpsSurvey()}>
7181
<Text style={styles.text}> SHOW NPS SURVEY </Text>
7282
</TouchableOpacity>
73-
<TouchableOpacity style={styles.button} onPress={() => this.showMultipleQuestionSurvey()}>
83+
<TouchableOpacity
84+
style={styles.button}
85+
onPress={() => this.showMultipleQuestionSurvey()}>
7486
<Text style={styles.text}> SHOW MULTIPLE QUESTION SURVEY </Text>
7587
</TouchableOpacity>
76-
<TouchableOpacity style={styles.button} onPress={() => this.showFeatureRequests()}>
88+
<TouchableOpacity
89+
style={styles.button}
90+
onPress={() => this.showFeatureRequests()}>
7791
<Text style={styles.text}> SHOW FEATURE REQUESTS </Text>
7892
</TouchableOpacity>
79-
<TouchableOpacity style={styles.button} onPress={() => this.showUnreadMessagesCount()}>
93+
<TouchableOpacity
94+
style={styles.button}
95+
onPress={() => this.showUnreadMessagesCount()}>
8096
<Text style={styles.text}> GET UNREAD MESSAGES COUNT </Text>
8197
</TouchableOpacity>
8298
{this.invocationEvent()}
@@ -100,8 +116,13 @@ export default class App extends Component<{}> {
100116
/>
101117
</View>
102118
<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+
/>
105126
</View>
106127
</ScrollView>
107128
</View>
@@ -115,32 +136,27 @@ export default class App extends Component<{}> {
115136
<View style={styles.rowView}>
116137
<TouchableOpacity
117138
style={styles.buttonColor}
118-
onPress={() => this.changeInvocationEvent('Shake')}
119-
>
139+
onPress={() => this.changeInvocationEvent('Shake')}>
120140
<Text style={styles.textInvoke}> SHAKE </Text>
121141
</TouchableOpacity>
122142
<TouchableOpacity
123143
style={styles.buttonColor}
124-
onPress={() => this.changeInvocationEvent('Screenshot')}
125-
>
144+
onPress={() => this.changeInvocationEvent('Screenshot')}>
126145
<Text style={styles.textInvoke}> SCREENSHOT </Text>
127146
</TouchableOpacity>
128147
<TouchableOpacity
129148
style={styles.buttonColor}
130-
onPress={() => this.changeInvocationEvent('twoFingersSwipe')}
131-
>
149+
onPress={() => this.changeInvocationEvent('twoFingersSwipe')}>
132150
<Text style={styles.textInvoke}> TWO FINGERS SWIPE LEFT</Text>
133151
</TouchableOpacity>
134152
<TouchableOpacity
135153
style={styles.buttonColor}
136-
onPress={() => this.changeInvocationEvent('Button')}
137-
>
154+
onPress={() => this.changeInvocationEvent('Button')}>
138155
<Text style={styles.textInvoke}> FLOATING BUTTON </Text>
139156
</TouchableOpacity>
140157
<TouchableOpacity
141158
style={styles.buttonColor}
142-
onPress={() => this.changeInvocationEvent('None')}
143-
>
159+
onPress={() => this.changeInvocationEvent('None')}>
144160
<Text style={styles.textInvoke}> NONE </Text>
145161
</TouchableOpacity>
146162
</View>
@@ -149,12 +165,12 @@ export default class App extends Component<{}> {
149165
}
150166

151167
toggleSwitch = value => {
152-
this.setState({ switchValue: value });
168+
this.setState({switchValue: value});
153169
if (value) {
154-
this.setState({ colorTheme: 'Light' });
170+
this.setState({colorTheme: 'Light'});
155171
Instabug.setColorTheme(Instabug.colorTheme.light);
156172
} else {
157-
this.setState({ colorTheme: 'Dark' });
173+
this.setState({colorTheme: 'Dark'});
158174
Instabug.setColorTheme(Instabug.colorTheme.dark);
159175
}
160176
};
@@ -206,11 +222,17 @@ export default class App extends Component<{}> {
206222
if (invocationEvent === 'Shake')
207223
BugReporting.setInvocationEvents([BugReporting.invocationEvent.shake]);
208224
if (invocationEvent === 'Button')
209-
BugReporting.setInvocationEvents([BugReporting.invocationEvent.floatingButton]);
225+
BugReporting.setInvocationEvents([
226+
BugReporting.invocationEvent.floatingButton,
227+
]);
210228
if (invocationEvent === 'Screenshot')
211-
BugReporting.setInvocationEvents([BugReporting.invocationEvent.screenshot]);
229+
BugReporting.setInvocationEvents([
230+
BugReporting.invocationEvent.screenshot,
231+
]);
212232
if (invocationEvent === 'twoFingersSwipe')
213-
BugReporting.setInvocationEvents([BugReporting.invocationEvent.twoFingersSwipe]);
233+
BugReporting.setInvocationEvents([
234+
BugReporting.invocationEvent.twoFingersSwipe,
235+
]);
214236
if (invocationEvent === 'None')
215237
BugReporting.setInvocationEvents([BugReporting.invocationEvent.none]);
216238
}
@@ -225,7 +247,7 @@ export default class App extends Component<{}> {
225247
});
226248
}
227249
}
228-
buttonColor = function(myColor) {
250+
buttonColor = function (myColor) {
229251
return {
230252
marginTop: 10,
231253
padding: 20,

0 commit comments

Comments
 (0)