@@ -16,7 +16,7 @@ import {
16
16
ScrollView
17
17
} from 'react-native' ;
18
18
19
- import Instabug from 'instabug-reactnative' ;
19
+ import Instabug , { BugReporting , FeatureRequests , Surveys } from 'instabug-reactnative' ;
20
20
21
21
22
22
const instructions = Platform . select ( {
@@ -139,30 +139,43 @@ export default class App extends Component<{}> {
139
139
}
140
140
141
141
invoke ( ) {
142
- Instabug . invoke ( ) ;
142
+ BugReporting . invoke ( ) ;
143
+ }
144
+
143
145
}
144
146
145
147
sendBugReport ( ) {
146
- Instabug . invokeWithInvocationMode ( Instabug . invocationMode . newBug ) ;
148
+ BugReporting . invokeWithInvocationModeAndOptions ( BugReporting . invocationMode . newBug , [ ] ) ;
149
+ }
150
+
151
+ sendCrashReport ( ) {
152
+ try {
153
+ throw new Error ( 'Text Handled Exception From Instabug Test App' ) ;
154
+ } catch ( Exception ) {
155
+ Instabug . reportJSException ( Exception ) ;
156
+ alert ( 'Crash report Sent!' ) ;
157
+ }
147
158
}
148
159
149
160
sendFeedback ( ) {
150
- Instabug . invokeWithInvocationMode ( Instabug . invocationMode . newFeedback ) ;
161
+ BugReporting . invokeWithInvocationModeAndOptions ( BugReporting . invocationMode . newFeedback , [ ] ) ;
151
162
}
152
163
153
164
changeInvocationEvent ( invocationEvent ) {
154
165
if ( invocationEvent === 'Shake' )
155
- Instabug . setInvocationEvent ( Instabug . invocationEvent . shake ) ;
166
+ BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . shake ] ) ;
156
167
if ( invocationEvent === 'Button' )
157
- Instabug . setInvocationEvent ( Instabug . invocationEvent . floatingButton ) ;
168
+ Instabug . setInvocationEvent ( BugReporting . invocationEvent . floatingButton ) ;
158
169
if ( invocationEvent === 'Screenshot' )
159
- Instabug . setInvocationEvent ( Instabug . invocationEvent . screenshot ) ;
170
+ BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . screenshot ] ) ;
171
+ if ( invocationEvent === 'twoFingersSwipe' )
172
+ BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . twoFingersSwipe ] ) ;
160
173
if ( invocationEvent === 'None' )
161
- Instabug . setInvocationEvent ( Instabug . invocationEvent . none ) ;
174
+ BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . none ] ) ;
162
175
}
163
176
164
177
startNewConversation ( ) {
165
- Instabug . invokeWithInvocationMode ( Instabug . invocationMode . newChat ) ;
178
+ BugReporting . invokeWithInvocationModeAndOptions ( BugReporting . invocationMode . newChat , [ ] ) ;
166
179
}
167
180
168
181
showUnreadMessagesCount ( ) {
0 commit comments