46
46
47
47
import com .instabug .reactlibrary .utils .ArrayUtil ;
48
48
import com .instabug .reactlibrary .utils .MapUtil ;
49
+ import com .instabug .survey .OnDismissCallback ;
50
+ import com .instabug .survey .OnShowCallback ;
49
51
import com .instabug .survey .Survey ;
50
52
import com .instabug .survey .Surveys ;
51
53
@@ -256,7 +258,7 @@ public void invokeWithInvocationMode(String invocationMode) {
256
258
@ ReactMethod
257
259
public void dismiss () {
258
260
try {
259
- BugReporting .dismiss ();
261
+ Instabug .dismiss ();
260
262
} catch (Exception e ) {
261
263
e .printStackTrace ();
262
264
}
@@ -1247,7 +1249,7 @@ public void setPreInvocationHandler(final Callback preInvocationHandler) {
1247
1249
try {
1248
1250
BugReporting .setOnInvokeCallback (new OnInvokeCallback () {
1249
1251
@ Override
1250
- public void call () {
1252
+ public void onInvoke () {
1251
1253
sendEvent (getReactApplicationContext (), "IBGpreInvocationHandler" , null );
1252
1254
}
1253
1255
});
@@ -1275,7 +1277,8 @@ public void run() {
1275
1277
}
1276
1278
};
1277
1279
1278
- BugReporting .onReportSubmitHandler (new Report .OnReportCreatedListener () {
1280
+
1281
+ Instabug .onReportSubmitHandler (new Report .OnReportCreatedListener () {
1279
1282
@ Override
1280
1283
public void onReportCreated (Report report ) {
1281
1284
WritableMap reportParam = Arguments .createMap ();
@@ -1368,17 +1371,13 @@ public void setIntroMessageEnabled(boolean enabled) {
1368
1371
*/
1369
1372
@ ReactMethod
1370
1373
public void setWillShowSurveyHandler (final Callback willShowSurveyHandler ) {
1371
- try {
1372
- Runnable willShowSurveyRunnable = new Runnable () {
1374
+
1375
+ Surveys . setOnShowCallback ( new OnShowCallback () {
1373
1376
@ Override
1374
- public void run () {
1377
+ public void onShow () {
1375
1378
sendEvent (getReactApplicationContext (), "IBGWillShowSurvey" , null );
1376
1379
}
1377
- };
1378
- Surveys .setOnShowCallback (willShowSurveyRunnable );
1379
- } catch (java .lang .Exception exception ) {
1380
- exception .printStackTrace ();
1381
- }
1380
+ });
1382
1381
}
1383
1382
1384
1383
/**
@@ -1390,17 +1389,13 @@ public void run() {
1390
1389
*/
1391
1390
@ ReactMethod
1392
1391
public void setDidDismissSurveyHandler (final Callback didDismissSurveyHandler ) {
1393
- try {
1394
- Runnable didDismissSurveyRunnable = new Runnable () {
1392
+
1393
+ Surveys . setOnDismissCallback ( new OnDismissCallback () {
1395
1394
@ Override
1396
- public void run () {
1395
+ public void onDismiss () {
1397
1396
sendEvent (getReactApplicationContext (), "IBGDidDismissSurvey" , null );
1398
1397
}
1399
- };
1400
- Surveys .setOnDismissCallback (didDismissSurveyRunnable );
1401
- } catch (java .lang .Exception exception ) {
1402
- exception .printStackTrace ();
1403
- }
1398
+ });
1404
1399
}
1405
1400
1406
1401
/**
0 commit comments