Skip to content

Commit ea8645f

Browse files
committed
💎 Bump version to 8.1.0
2 parents aacfabb + 6316411 commit ea8645f

File tree

117 files changed

+18573
-2243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+18573
-2243
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ android/.DS_Store
66
ios/.DS_Store
77

88
build/
9+
.gradle
10+
local.properties
11+
.idea
912
/android/src/main/java/com/instabug/reactlibrary/wrappedAPIs
1013

1114
# Xcode

InstabugSample/.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

InstabugSample/.flowconfig

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,23 @@ node_modules/react-native/flow-github/
2929
[options]
3030
emoji=true
3131

32+
esproposal.optional_chaining=enable
33+
esproposal.nullish_coalescing=enable
34+
3235
module.system=haste
36+
module.system.haste.use_name_reducers=true
37+
# get basename
38+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
39+
# strip .js or .js.flow suffix
40+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
41+
# strip .ios suffix
42+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
43+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
44+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
45+
module.system.haste.paths.blacklist=.*/__tests__/.*
46+
module.system.haste.paths.blacklist=.*/__mocks__/.*
47+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
48+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
3349

3450
munge_underscores=true
3551

@@ -50,7 +66,5 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*
5066
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5167
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5268

53-
unsafe.enable_getters_and_setters=true
54-
5569
[version]
56-
^0.61.0
70+
^0.86.0

InstabugSample/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ buck-out/
5151
*/fastlane/report.xml
5252
*/fastlane/Preview.html
5353
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle

InstabugSample/App.js

Lines changed: 77 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
ScrollView
1717
} from 'react-native';
1818

19-
import Instabug from'instabug-reactnative';
19+
import Instabug, {BugReporting, FeatureRequests, Surveys, Chats, CrashReporting, Replies} from'instabug-reactnative';
2020

2121

2222
const instructions = Platform.select({
@@ -31,12 +31,12 @@ export default class App extends Component<{}> {
3131
constructor(props) {
3232
super(props);
3333
this.state = {
34-
switchValue: false,
35-
colorTheme: 'Dark'
34+
switchValue: true,
35+
colorTheme: 'Light'
3636
};
37-
Instabug.startWithToken("APP_TOKEN", Instabug.invocationEvent.shake);
38-
Instabug.setReportCategories("Performance","UI","Flow","Other");
39-
Instabug.setPromptOptionsEnabled(true, true, true);
37+
38+
Instabug.startWithToken("APP_TOKEN", [Instabug.invocationEvent.shake]);
39+
BugReporting.setReportTypes([BugReporting.reportType.bug, BugReporting.reportType.feedback]);
4040
Instabug.setLocale(Instabug.locale.english);
4141
}
4242

@@ -48,9 +48,6 @@ export default class App extends Component<{}> {
4848
Hello {"Instabug's"} awesome user! The purpose of this application is to show you the different
4949
options for customizing the SDK and how easy it is to integrate it to your existing app
5050
</Text>
51-
<TouchableOpacity style={styles.button} onPress={()=>this.showIntroMessage()}>
52-
<Text style={styles.text}> SHOW INTRO MESSAGE </Text>
53-
</TouchableOpacity>
5451
<TouchableOpacity style={styles.button} onPress={()=>this.invoke()}>
5552
<Text style={styles.text}> INVOKE </Text>
5653
</TouchableOpacity>
@@ -60,27 +57,31 @@ export default class App extends Component<{}> {
6057
<TouchableOpacity style={styles.button} onPress={()=>this.sendFeedback()}>
6158
<Text style={styles.text}> SEND FEEDBACK </Text>
6259
</TouchableOpacity>
60+
<TouchableOpacity style={styles.button} onPress={()=>this.sendCrashReport()}>
61+
<Text style={styles.text}> THROW HANDLED EXCEPTION </Text>
62+
</TouchableOpacity>
6363
<TouchableOpacity style={styles.button} onPress={()=>this.startNewConversation()}>
6464
<Text style={styles.text}> START A NEW CONVERSATION </Text>
6565
</TouchableOpacity>
66+
<TouchableOpacity style={styles.button} onPress={()=>this.showNpsSurvey()}>
67+
<Text style={styles.text}> SHOW NPS SURVEY </Text>
68+
</TouchableOpacity>
69+
<TouchableOpacity style={styles.button} onPress={()=>this.showMultipleQuestionSurvey()}>
70+
<Text style={styles.text}> SHOW MULTIPLE QUESTION SURVEY </Text>
71+
</TouchableOpacity>
72+
<TouchableOpacity style={styles.button} onPress={()=>this.showFeatureRequests()}>
73+
<Text style={styles.text}> SHOW FEATURE REQUESTS </Text>
74+
</TouchableOpacity>
6675
<TouchableOpacity style={styles.button} onPress={()=>this.showUnreadMessagesCount()}>
6776
<Text style={styles.text}> GET UNREAD MESSAGES COUNT </Text>
6877
</TouchableOpacity>
6978
{this.invocationEvent()}
7079
<Text style={styles.textColor}> Set primary color </Text>
7180
<View style={styles.rowView}>
72-
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.setPrimaryColor('#FF0000')}>
73-
<Text style={styles.text}> RED </Text>
74-
</TouchableOpacity>
75-
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.setPrimaryColor('#00FF00')}>
76-
<Text style={styles.text}> GREEN </Text>
77-
</TouchableOpacity>
78-
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.setPrimaryColor('#0000FF')}>
79-
<Text style={styles.text}> BLUE </Text>
80-
</TouchableOpacity>
81-
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.setPrimaryColor('#FFFF00')}>
82-
<Text style={styles.text}> YELLOW </Text>
83-
</TouchableOpacity>
81+
<TouchableOpacity style={buttonColor('#FF0000')} onPress={()=>this.setPrimaryColor('#FF0000')}/>
82+
<TouchableOpacity style={buttonColor('#00FF00')} onPress={()=>this.setPrimaryColor('#00FF00')}/>
83+
<TouchableOpacity style={buttonColor('#0000FF')} onPress={()=>this.setPrimaryColor('#0000FF')}/>
84+
<TouchableOpacity style={buttonColor('#FFFF00')} onPress={()=>this.setPrimaryColor('#FFFF00')}/>
8485
</View>
8586
<View style={styles.switchView}>
8687
<Text style={styles.textSwitchStyle}>Color Theme: {this.state.colorTheme}</Text>
@@ -94,28 +95,28 @@ export default class App extends Component<{}> {
9495
}
9596

9697
invocationEvent() {
97-
if(Platform.OS === 'ios') {
9898
return(
9999
<View>
100100
<Text style={styles.textColor}> Change Invocation Event </Text>
101101
<View style={styles.rowView}>
102102
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('Shake')}>
103103
<Text style={styles.textInvoke}> SHAKE </Text>
104104
</TouchableOpacity>
105-
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('Button')}>
106-
<Text style={styles.textInvoke}> FLOATING BUTTON </Text>
107-
</TouchableOpacity>
108105
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('Screenshot')}>
109106
<Text style={styles.textInvoke}> SCREENSHOT </Text>
110107
</TouchableOpacity>
108+
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('twoFingersSwipe')}>
109+
<Text style={styles.textInvoke}> TWO FINGERS SWIPE LEFT</Text>
110+
</TouchableOpacity>
111+
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('Button')}>
112+
<Text style={styles.textInvoke}> FLOATING BUTTON </Text>
113+
</TouchableOpacity>
111114
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('None')}>
112115
<Text style={styles.textInvoke}> NONE </Text>
113116
</TouchableOpacity>
114117
</View>
115118
</View>
116119
);
117-
}
118-
return;
119120
}
120121

121122
toggleSwitch = (value) => {
@@ -138,44 +139,78 @@ export default class App extends Component<{}> {
138139
}
139140

140141
invoke() {
141-
Instabug.invoke();
142+
Instabug.show();
143+
}
144+
145+
showMultipleQuestionSurvey() {
146+
Surveys.showSurvey("ZAKSlVz98QdPyOx1wIt8BA");
147+
}
148+
149+
showNpsSurvey() {
150+
Surveys.showSurvey("pcV_mE2ttqHxT1iqvBxL0w");
151+
}
152+
153+
showFeatureRequests() {
154+
FeatureRequests.show();
142155
}
143156

144157
sendBugReport() {
145-
Instabug.invokeWithInvocationMode(Instabug.invocationMode.newBug);
158+
BugReporting.showWithOptions(BugReporting.reportType.bug);
159+
}
160+
161+
sendCrashReport() {
162+
try {
163+
throw new Error('Text Handled Exception From Instabug Test App');
164+
} catch (Exception) {
165+
CrashReporting.reportJSException(Exception);
166+
alert('Crash report Sent!');
167+
}
146168
}
147169

148170
sendFeedback() {
149-
Instabug.invokeWithInvocationMode(Instabug.invocationMode.newFeedback);
171+
BugReporting.showWithOptions(BugReporting.reportType.feedback, [BugReporting.option.emailFieldHidden]);
172+
150173
}
151174

152175
changeInvocationEvent(invocationEvent) {
153176
if(invocationEvent === 'Shake')
154-
Instabug.setInvocationEvent(Instabug.invocationEvent.shake);
177+
BugReporting.setInvocationEvents([BugReporting.invocationEvent.shake]);
155178
if(invocationEvent === 'Button')
156-
Instabug.setInvocationEvent(Instabug.invocationEvent.floatingButton);
179+
BugReporting.setInvocationEvents([BugReporting.invocationEvent.floatingButton]);
157180
if(invocationEvent === 'Screenshot')
158-
Instabug.setInvocationEvent(Instabug.invocationEvent.screenshot);
181+
BugReporting.setInvocationEvents([BugReporting.invocationEvent.screenshot]);
182+
if(invocationEvent === 'twoFingersSwipe')
183+
BugReporting.setInvocationEvents([BugReporting.invocationEvent.twoFingersSwipe]);
159184
if(invocationEvent === 'None')
160-
Instabug.setInvocationEvent(Instabug.invocationEvent.none);
185+
BugReporting.setInvocationEvents([BugReporting.invocationEvent.none]);
161186
}
162187

163188
startNewConversation() {
164-
Instabug.invokeWithInvocationMode(Instabug.invocationMode.newChat);
189+
Chats.show();
165190
}
166191

167192
showUnreadMessagesCount() {
168-
Instabug.getUnreadMessagesCount((count) => {
193+
Replies.getUnreadRepliesCount((count) => {
169194
alert("Messages: " + count);
170195
});
171196
}
172197
}
173-
198+
buttonColor = function(myColor) {
199+
return {
200+
marginTop: 10,
201+
padding: 20,
202+
paddingRight : 40,
203+
alignItems: 'center',
204+
borderRadius: 5,
205+
marginRight: 5,
206+
backgroundColor: myColor,
207+
}
208+
}
174209
const styles = StyleSheet.create({
175210
container: {
176211
flex: 1,
177212
alignItems: 'center',
178-
backgroundColor: '#F5FCFF',
213+
backgroundColor: '#F5FCFF'
179214
},
180215
details: {
181216
textAlign: 'center',
@@ -197,7 +232,10 @@ const styles = StyleSheet.create({
197232
},
198233
rowView: {
199234
flexDirection: 'row',
200-
marginTop: 10
235+
marginTop: 10,
236+
maxWidth : '100%',
237+
flexGrow: 1,
238+
flexWrap: 'wrap'
201239
},
202240
textColor: {
203241
fontSize: 14,
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
/**
2+
* @format
3+
* @lint-ignore-every XPLATJSCOPYRIGHT1
4+
*/
5+
16
import 'react-native';
27
import React from 'react';
3-
import Index from '../index.android.js';
8+
import App from '../App';
49

510
// Note: test renderer must be required after react-native.
611
import renderer from 'react-test-renderer';
712

813
it('renders correctly', () => {
9-
const tree = renderer.create(
10-
<Index />
11-
);
14+
renderer.create(<App />);
1215
});

InstabugSample/__tests__/index.ios.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

InstabugSample/android/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>InstabugSample</name>
4+
<comment>Project android created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=
2+
eclipse.preferences.version=1

InstabugSample/android/app/.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin/default"/>
6+
</classpath>

0 commit comments

Comments
 (0)