File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
android/src/main/java/com/instabug/reactlibrary Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 23
23
import com .instabug .library .bugreporting .model .ReportCategory ;
24
24
import com .instabug .library .InstabugCustomTextPlaceHolder ;
25
25
import com .instabug .library .user .UserEventParam ;
26
+ import com .instabug .library .OnSdkDismissedCallback ;
27
+ import com .instabug .library .bugreporting .model .Bug ;
26
28
27
29
import com .instabug .reactlibrary .utils .ArrayUtil ;
28
30
import com .instabug .reactlibrary .utils .MapUtil ;
@@ -925,6 +927,30 @@ public void run() {
925
927
}
926
928
}
927
929
930
+ /**
931
+ * Sets a block of code to be executed right after the SDK's UI is dismissed.
932
+ * This block is executed on the UI thread. Could be used for performing any
933
+ * UI changes after the SDK's UI is dismissed.
934
+ *
935
+ * @param {postInvocationHandler} postInvocationHandler - A callback to get executed after
936
+ * dismissing the SDK.
937
+ */
938
+ @ ReactMethod
939
+ public void setPostInvocationHandler (final Callback postInvocationHandler ) {
940
+ try {
941
+
942
+ mInstabug .setOnSdkDismissedCallback (new OnSdkDismissedCallback () {
943
+ @ Override
944
+ public void onSdkDismissed (DismissType issueState , Bug .Type bugType ) {
945
+ postInvocationHandler .invoke ();
946
+ }
947
+ });
948
+
949
+ } catch (java .lang .Exception exception ) {
950
+ exception .printStackTrace ();
951
+ }
952
+ }
953
+
928
954
private InstabugCustomTextPlaceHolder .Key getStringToKeyConstant (String key ) {
929
955
String keyInLowerCase = key .toLowerCase ();
930
956
switch (keyInLowerCase ) {
Original file line number Diff line number Diff line change @@ -150,9 +150,10 @@ module.exports = {
150
150
postInvocationHandler ( payload [ 'dismissType' ] , payload [ 'reportType' ] ) ;
151
151
}
152
152
) ;
153
-
154
- Instabug . setPostInvocationHandler ( postInvocationHandler ) ;
155
153
}
154
+
155
+ Instabug . setPostInvocationHandler ( postInvocationHandler ) ;
156
+
156
157
} ,
157
158
158
159
/**
You can’t perform that action at this time.
0 commit comments