From b59ae35aaa790635f98d06df15340f3acb218bb5 Mon Sep 17 00:00:00 2001 From: yousefhamza Date: Wed, 21 Jun 2017 11:46:54 +0200 Subject: [PATCH] Add implementation to react native methods --- InstabugSample/index.ios.js | 11 ++++- .../InstabugSample.xcodeproj/project.pbxproj | 41 +++++++++++++------ ios/RNInstabug/InstabugReactBridge.m | 36 +++++++++++++++- 3 files changed, 73 insertions(+), 15 deletions(-) diff --git a/InstabugSample/index.ios.js b/InstabugSample/index.ios.js index 26092fd..ba7ebfe 100644 --- a/InstabugSample/index.ios.js +++ b/InstabugSample/index.ios.js @@ -28,6 +28,7 @@ export default class InstabugSample extends Component { constructor(props) { super(props); Instabug.startWithToken('0f0dc916bd9175e3b5d2fdf0cfa49a69', Instabug.invocationEvent.shake); + const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); this.state = { dataSource: ds.cloneWithRows(this._genRows({})), @@ -61,7 +62,8 @@ export default class InstabugSample extends Component { "Unread messages count", "Set locale", "Set color theme", - "Set primary color" + "Set primary color", + "Show surveys" ]; return dataBlob; } @@ -85,6 +87,8 @@ export default class InstabugSample extends Component { this._showColorThemeActionSheet(); } else if (rowID == 7) { this._showPrimaryColorActionSheet(); + } else if (rowID == 8) { + this._showSurveys(); } } @@ -225,6 +229,11 @@ export default class InstabugSample extends Component { }); } + _showSurveys() { + console.log("show surveys") + Instabug.showSurveysIfAvailable() + } + _renderSeparator(sectionID: number, rowID: number, adjacentRowHighlighted: bool) { return (