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 2323import com .instabug .library .bugreporting .model .ReportCategory ;
2424import com .instabug .library .InstabugCustomTextPlaceHolder ;
2525import com .instabug .library .user .UserEventParam ;
26+ import com .instabug .library .OnSdkDismissedCallback ;
27+ import com .instabug .library .bugreporting .model .Bug ;
2628
2729import com .instabug .reactlibrary .utils .ArrayUtil ;
2830import com .instabug .reactlibrary .utils .MapUtil ;
@@ -925,6 +927,30 @@ public void run() {
925927 }
926928 }
927929
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+
928954 private InstabugCustomTextPlaceHolder .Key getStringToKeyConstant (String key ) {
929955 String keyInLowerCase = key .toLowerCase ();
930956 switch (keyInLowerCase ) {
Original file line number Diff line number Diff line change @@ -150,9 +150,10 @@ module.exports = {
150150 postInvocationHandler ( payload [ 'dismissType' ] , payload [ 'reportType' ] ) ;
151151 }
152152 ) ;
153-
154- Instabug . setPostInvocationHandler ( postInvocationHandler ) ;
155153 }
154+
155+ Instabug . setPostInvocationHandler ( postInvocationHandler ) ;
156+
156157 } ,
157158
158159 /**
You can’t perform that action at this time.
0 commit comments