File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
android/src/main/java/com/instabug/reactlibrary Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -901,6 +901,30 @@ public void run() {
901
901
}
902
902
}
903
903
904
+ /**
905
+ * Sets a block of code to be executed before sending each report.
906
+ * This block is executed in the background before sending each report. Could
907
+ * be used for attaching logs and extra data to reports.
908
+ *
909
+ * @param {preSendingHandler} preSendingHandler - A callback that gets executed before
910
+ * sending each bug
911
+ * report.
912
+ */
913
+ @ ReactMethod
914
+ public void setPreSendingHandler (final Callback preSendingHandler ) {
915
+ try {
916
+ Runnable preSendingRunnable = new Runnable () {
917
+ @ Override
918
+ public void run () {
919
+ preSendingHandler .invoke ();
920
+ }
921
+ };
922
+ mInstabug .setPreSendingRunnable (preSendingRunnable );
923
+ } catch (java .lang .Exception exception ) {
924
+ exception .printStackTrace ();
925
+ }
926
+ }
927
+
904
928
private InstabugCustomTextPlaceHolder .Key getStringToKeyConstant (String key ) {
905
929
String keyInLowerCase = key .toLowerCase ();
906
930
switch (keyInLowerCase ) {
Original file line number Diff line number Diff line change @@ -109,8 +109,10 @@ module.exports = {
109
109
preSendingHandler
110
110
) ;
111
111
112
- Instabug . setPreSendingHandler ( preSendingHandler ) ;
113
112
}
113
+
114
+ Instabug . setPreSendingHandler ( preSendingHandler ) ;
115
+
114
116
} ,
115
117
116
118
/**
You can’t perform that action at this time.
0 commit comments