Skip to content

Commit

Permalink
Release v9.0.5 (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
alyezz authored Jan 27, 2020
1 parent 4539172 commit 9ebe1ae
Show file tree
Hide file tree
Showing 63 changed files with 544 additions and 429 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v9.0.5 (2020-01-27)

* Bump iOS Native SDK to v9.0.4
* Bump Android Native SDK to v9.0.5

## v9.0.1 (2019-12-14)

* Updated iOS native SDK to v9.0.3
Expand Down
16 changes: 16 additions & 0 deletions InstabugSample/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
printWidth : 100,
tabWidth : 2,
useTabs : false,
semi : true,
singleQuote : true,
trailingComma : "es5",
bracketSpacing : true,
jsxBracketSameLine : false,
arrowParens : "avoid",
rangeStart : 0,
parser : "babel",
requirePragma : false,
insertPragma : false,
proseWrap : "preserve"
}
210 changes: 121 additions & 89 deletions InstabugSample/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,120 +13,151 @@ import {
TouchableOpacity,
processColor,
Switch,
ScrollView
ScrollView,
} from 'react-native';

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

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

const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' +
'Cmd+D or shake for dev menu',
android: 'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
android: 'Double tap R on your keyboard to reload,\n' + 'Shake or press menu button for dev menu',
});

export default class App extends Component<{}> {

constructor(props) {
super(props);
this.state = {
switchValue: true,
colorTheme: 'Light'
colorTheme: 'Light',
};

Instabug.startWithToken("YOUR_TOKEN", [Instabug.invocationEvent.floatingButton]);
Instabug.startWithToken('068ba9a8c3615035e163dc5f829c73be', [
Instabug.invocationEvent.floatingButton,
]);
}

render() {
return (
<View testID='welcome' style={styles.container}>
<ScrollView contentContainerStyle={styles.contentContainer} >
<View testID="welcome" style={styles.container}>
<ScrollView contentContainerStyle={styles.contentContainer}>
<Text style={styles.details}>
Hello {"Instabug's"} awesome user! The purpose of this application is to show you the different
options for customizing the SDK and how easy it is to integrate it to your existing app
Hello {"Instabug's"} awesome user! The purpose of this application is to show you the
different options for customizing the SDK and how easy it is to integrate it to your
existing app
</Text>
<TouchableOpacity style={styles.button} onPress={()=>this.invoke()}>
<TouchableOpacity style={styles.button} onPress={() => this.invoke()}>
<Text style={styles.text}> INVOKE </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={()=>this.sendBugReport()}>
<TouchableOpacity style={styles.button} onPress={() => this.sendBugReport()}>
<Text style={styles.text}> SEND BUG REPORT </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={()=>this.sendFeedback()}>
<TouchableOpacity style={styles.button} onPress={() => this.sendFeedback()}>
<Text style={styles.text}> SEND FEEDBACK </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={()=>this.startNewConversation()}>
<TouchableOpacity style={styles.button} onPress={() => this.startNewConversation()}>
<Text style={styles.text}> ASK A QUESTION </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={()=>this.sendCrashReport()}>
<TouchableOpacity style={styles.button} onPress={() => this.sendCrashReport()}>
<Text style={styles.text}> THROW HANDLED EXCEPTION </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={()=>this.showNpsSurvey()}>
<TouchableOpacity style={styles.button} onPress={() => this.showNpsSurvey()}>
<Text style={styles.text}> SHOW NPS SURVEY </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={()=>this.showMultipleQuestionSurvey()}>
<TouchableOpacity style={styles.button} onPress={() => this.showMultipleQuestionSurvey()}>
<Text style={styles.text}> SHOW MULTIPLE QUESTION SURVEY </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={()=>this.showFeatureRequests()}>
<TouchableOpacity style={styles.button} onPress={() => this.showFeatureRequests()}>
<Text style={styles.text}> SHOW FEATURE REQUESTS </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={()=>this.showUnreadMessagesCount()}>
<TouchableOpacity style={styles.button} onPress={() => this.showUnreadMessagesCount()}>
<Text style={styles.text}> GET UNREAD MESSAGES COUNT </Text>
</TouchableOpacity>
{this.invocationEvent()}
<Text style={styles.textColor}> Set primary color </Text>
<View style={styles.rowView}>
<TouchableOpacity style={buttonColor('#FF0000')} onPress={()=>this.setPrimaryColor('#FF0000')}/>
<TouchableOpacity style={buttonColor('#00FF00')} onPress={()=>this.setPrimaryColor('#00FF00')}/>
<TouchableOpacity style={buttonColor('#0000FF')} onPress={()=>this.setPrimaryColor('#0000FF')}/>
<TouchableOpacity style={buttonColor('#FFFF00')} onPress={()=>this.setPrimaryColor('#FFFF00')}/>
<TouchableOpacity
style={buttonColor('#FF0000')}
onPress={() => this.setPrimaryColor('#FF0000')}
/>
<TouchableOpacity
style={buttonColor('#00FF00')}
onPress={() => this.setPrimaryColor('#00FF00')}
/>
<TouchableOpacity
style={buttonColor('#0000FF')}
onPress={() => this.setPrimaryColor('#0000FF')}
/>
<TouchableOpacity
style={buttonColor('#FFFF00')}
onPress={() => this.setPrimaryColor('#FFFF00')}
/>
</View>
<View style={styles.switchView}>
<Text style={styles.textSwitchStyle}>Color Theme: {this.state.colorTheme}</Text>
<Switch
onValueChange = {this.toggleSwitch}
value = {this.state.switchValue}/>
<Switch onValueChange={this.toggleSwitch} value={this.state.switchValue} />
</View>
</ScrollView>
</View>
);
}

invocationEvent() {
return(
<View>
<Text style={styles.textColor}> Change Invocation Event </Text>
<View style={styles.rowView}>
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('Shake')}>
<Text style={styles.textInvoke}> SHAKE </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('Screenshot')}>
<Text style={styles.textInvoke}> SCREENSHOT </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('twoFingersSwipe')}>
<Text style={styles.textInvoke}> TWO FINGERS SWIPE LEFT</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('Button')}>
<Text style={styles.textInvoke}> FLOATING BUTTON </Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonColor} onPress={()=>this.changeInvocationEvent('None')}>
<Text style={styles.textInvoke}> NONE </Text>
</TouchableOpacity>
</View>
return (
<View>
<Text style={styles.textColor}> Change Invocation Event </Text>
<View style={styles.rowView}>
<TouchableOpacity
style={styles.buttonColor}
onPress={() => this.changeInvocationEvent('Shake')}
>
<Text style={styles.textInvoke}> SHAKE </Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.buttonColor}
onPress={() => this.changeInvocationEvent('Screenshot')}
>
<Text style={styles.textInvoke}> SCREENSHOT </Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.buttonColor}
onPress={() => this.changeInvocationEvent('twoFingersSwipe')}
>
<Text style={styles.textInvoke}> TWO FINGERS SWIPE LEFT</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.buttonColor}
onPress={() => this.changeInvocationEvent('Button')}
>
<Text style={styles.textInvoke}> FLOATING BUTTON </Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.buttonColor}
onPress={() => this.changeInvocationEvent('None')}
>
<Text style={styles.textInvoke}> NONE </Text>
</TouchableOpacity>
</View>
);
</View>
);
}

toggleSwitch = (value) => {
this.setState({switchValue: value})
if(value) {
this.setState({colorTheme: 'Light'});
Instabug.setColorTheme(Instabug.colorTheme.light);
} else {
this.setState({colorTheme: 'Dark'});
Instabug.setColorTheme(Instabug.colorTheme.dark);
}
}
toggleSwitch = value => {
this.setState({ switchValue: value });
if (value) {
this.setState({ colorTheme: 'Light' });
Instabug.setColorTheme(Instabug.colorTheme.light);
} else {
this.setState({ colorTheme: 'Dark' });
Instabug.setColorTheme(Instabug.colorTheme.dark);
}
};

setPrimaryColor(color) {
Instabug.setPrimaryColor(color);
Expand All @@ -141,11 +172,11 @@ export default class App extends Component<{}> {
}

showMultipleQuestionSurvey() {
Surveys.showSurvey("ZAKSlVz98QdPyOx1wIt8BA");
Surveys.showSurvey('ZAKSlVz98QdPyOx1wIt8BA');
}

showNpsSurvey() {
Surveys.showSurvey("pcV_mE2ttqHxT1iqvBxL0w");
Surveys.showSurvey('pcV_mE2ttqHxT1iqvBxL0w');
}

showFeatureRequests() {
Expand All @@ -158,28 +189,29 @@ export default class App extends Component<{}> {

sendCrashReport() {
try {
throw new Error('Text Handled Exception From Instabug Test App');
throw new Error('Text Handled Exception From Instabug Test App');
} catch (Exception) {
CrashReporting.reportJSException(Exception);
alert('Crash report Sent!');
}
}

sendFeedback() {
BugReporting.showWithOptions(BugReporting.reportType.feedback, [BugReporting.option.emailFieldHidden]);

BugReporting.showWithOptions(BugReporting.reportType.feedback, [
BugReporting.option.emailFieldHidden,
]);
}

changeInvocationEvent(invocationEvent) {
if(invocationEvent === 'Shake')
if (invocationEvent === 'Shake')
BugReporting.setInvocationEvents([BugReporting.invocationEvent.shake]);
if(invocationEvent === 'Button')
if (invocationEvent === 'Button')
BugReporting.setInvocationEvents([BugReporting.invocationEvent.floatingButton]);
if(invocationEvent === 'Screenshot')
if (invocationEvent === 'Screenshot')
BugReporting.setInvocationEvents([BugReporting.invocationEvent.screenshot]);
if(invocationEvent === 'twoFingersSwipe')
if (invocationEvent === 'twoFingersSwipe')
BugReporting.setInvocationEvents([BugReporting.invocationEvent.twoFingersSwipe]);
if(invocationEvent === 'None')
if (invocationEvent === 'None')
BugReporting.setInvocationEvents([BugReporting.invocationEvent.none]);
}

Expand All @@ -188,52 +220,52 @@ export default class App extends Component<{}> {
}

showUnreadMessagesCount() {
Replies.getUnreadRepliesCount((count) => {
alert("Messages: " + count);
Replies.getUnreadRepliesCount(count => {
alert('Messages: ' + count);
});
}
}
buttonColor = function(myColor) {
return {
marginTop: 10,
padding: 20,
paddingRight : 40,
paddingRight: 40,
alignItems: 'center',
borderRadius: 5,
marginRight: 5,
backgroundColor: myColor,
}
}
};
};
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
backgroundColor: '#F5FCFF'
backgroundColor: '#F5FCFF',
},
details: {
textAlign: 'center',
color: '#333333',
margin: 20,
marginTop: Platform.OS === 'ios' ? 40 : 20
marginTop: Platform.OS === 'ios' ? 40 : 20,
},
text: {
color: '#FFFFFF',
fontSize: 12,
fontWeight: 'bold'
fontWeight: 'bold',
},
button: {
marginTop: 10,
backgroundColor: "#1D82DC",
backgroundColor: '#1D82DC',
padding: 10,
alignItems: 'center',
borderRadius: 5
borderRadius: 5,
},
rowView: {
flexDirection: 'row',
marginTop: 10,
maxWidth : '100%',
maxWidth: '100%',
flexGrow: 1,
flexWrap: 'wrap'
flexWrap: 'wrap',
},
textColor: {
fontSize: 14,
Expand All @@ -242,16 +274,16 @@ const styles = StyleSheet.create({
},
buttonColor: {
marginTop: 10,
backgroundColor: "#1D82DC",
backgroundColor: '#1D82DC',
padding: 10,
alignItems: 'center',
borderRadius: 5,
marginRight: 5
marginRight: 5,
},
textSwitchStyle: {
marginTop: 10,
marginRight: 5,
fontWeight: 'bold'
fontWeight: 'bold',
},
switchView: {
flexDirection: 'row',
Expand All @@ -260,9 +292,9 @@ const styles = StyleSheet.create({
textInvoke: {
color: '#FFFFFF',
fontSize: 10,
fontWeight: 'bold'
fontWeight: 'bold',
},
contentContainer: {
padding: 10
}
padding: 10,
},
});
2 changes: 1 addition & 1 deletion InstabugSample/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
compileSdkVersion = 28
compileSdkVersion = 29
targetSdkVersion = 28
supportLibVersion = "28.0.0"
kotlinVersion = '1.3.10'
Expand Down
Loading

0 comments on commit 9ebe1ae

Please sign in to comment.