4646
4747import com .instabug .reactlibrary .utils .ArrayUtil ;
4848import com .instabug .reactlibrary .utils .MapUtil ;
49+ import com .instabug .survey .OnDismissCallback ;
50+ import com .instabug .survey .OnShowCallback ;
4951import com .instabug .survey .Survey ;
5052import com .instabug .survey .Surveys ;
5153
@@ -256,7 +258,7 @@ public void invokeWithInvocationMode(String invocationMode) {
256258 @ ReactMethod
257259 public void dismiss () {
258260 try {
259- BugReporting .dismiss ();
261+ Instabug .dismiss ();
260262 } catch (Exception e ) {
261263 e .printStackTrace ();
262264 }
@@ -1247,7 +1249,7 @@ public void setPreInvocationHandler(final Callback preInvocationHandler) {
12471249 try {
12481250 BugReporting .setOnInvokeCallback (new OnInvokeCallback () {
12491251 @ Override
1250- public void call () {
1252+ public void onInvoke () {
12511253 sendEvent (getReactApplicationContext (), "IBGpreInvocationHandler" , null );
12521254 }
12531255 });
@@ -1275,7 +1277,8 @@ public void run() {
12751277 }
12761278 };
12771279
1278- BugReporting .onReportSubmitHandler (new Report .OnReportCreatedListener () {
1280+
1281+ Instabug .onReportSubmitHandler (new Report .OnReportCreatedListener () {
12791282 @ Override
12801283 public void onReportCreated (Report report ) {
12811284 WritableMap reportParam = Arguments .createMap ();
@@ -1368,17 +1371,13 @@ public void setIntroMessageEnabled(boolean enabled) {
13681371 */
13691372 @ ReactMethod
13701373 public void setWillShowSurveyHandler (final Callback willShowSurveyHandler ) {
1371- try {
1372- Runnable willShowSurveyRunnable = new Runnable () {
1374+
1375+ Surveys . setOnShowCallback ( new OnShowCallback () {
13731376 @ Override
1374- public void run () {
1377+ public void onShow () {
13751378 sendEvent (getReactApplicationContext (), "IBGWillShowSurvey" , null );
13761379 }
1377- };
1378- Surveys .setOnShowCallback (willShowSurveyRunnable );
1379- } catch (java .lang .Exception exception ) {
1380- exception .printStackTrace ();
1381- }
1380+ });
13821381 }
13831382
13841383 /**
@@ -1390,17 +1389,13 @@ public void run() {
13901389 */
13911390 @ ReactMethod
13921391 public void setDidDismissSurveyHandler (final Callback didDismissSurveyHandler ) {
1393- try {
1394- Runnable didDismissSurveyRunnable = new Runnable () {
1392+
1393+ Surveys . setOnDismissCallback ( new OnDismissCallback () {
13951394 @ Override
1396- public void run () {
1395+ public void onDismiss () {
13971396 sendEvent (getReactApplicationContext (), "IBGDidDismissSurvey" , null );
13981397 }
1399- };
1400- Surveys .setOnDismissCallback (didDismissSurveyRunnable );
1401- } catch (java .lang .Exception exception ) {
1402- exception .printStackTrace ();
1403- }
1398+ });
14041399 }
14051400
14061401 /**
0 commit comments