@@ -16,7 +16,7 @@ import {
1616 ScrollView
1717} from 'react-native' ;
1818
19- import Instabug from 'instabug-reactnative' ;
19+ import Instabug , { BugReporting , FeatureRequests , Surveys } from 'instabug-reactnative' ;
2020
2121
2222const instructions = Platform . select ( {
@@ -139,30 +139,43 @@ export default class App extends Component<{}> {
139139 }
140140
141141 invoke ( ) {
142- Instabug . invoke ( ) ;
142+ BugReporting . invoke ( ) ;
143+ }
144+
143145 }
144146
145147 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+ }
147158 }
148159
149160 sendFeedback ( ) {
150- Instabug . invokeWithInvocationMode ( Instabug . invocationMode . newFeedback ) ;
161+ BugReporting . invokeWithInvocationModeAndOptions ( BugReporting . invocationMode . newFeedback , [ ] ) ;
151162 }
152163
153164 changeInvocationEvent ( invocationEvent ) {
154165 if ( invocationEvent === 'Shake' )
155- Instabug . setInvocationEvent ( Instabug . invocationEvent . shake ) ;
166+ BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . shake ] ) ;
156167 if ( invocationEvent === 'Button' )
157- Instabug . setInvocationEvent ( Instabug . invocationEvent . floatingButton ) ;
168+ Instabug . setInvocationEvent ( BugReporting . invocationEvent . floatingButton ) ;
158169 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 ] ) ;
160173 if ( invocationEvent === 'None' )
161- Instabug . setInvocationEvent ( Instabug . invocationEvent . none ) ;
174+ BugReporting . setInvocationEvents ( [ BugReporting . invocationEvent . none ] ) ;
162175 }
163176
164177 startNewConversation ( ) {
165- Instabug . invokeWithInvocationMode ( Instabug . invocationMode . newChat ) ;
178+ BugReporting . invokeWithInvocationModeAndOptions ( BugReporting . invocationMode . newChat , [ ] ) ;
166179 }
167180
168181 showUnreadMessagesCount ( ) {
0 commit comments