File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
android/src/main/java/com/instabug/flutter Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## [ Unreleased] ( https://github.com/Instabug/Instabug-Flutter/compare/v11.12.0...dev )
4
+
5
+ ### Fixed
6
+
7
+ - Fix an issue with the ` onInvoke ` callback not being called and causing ` Instabug.show ` to break on Android ([ #369 ] ( https://github.com/Instabug/Instabug-Flutter/pull/369 ) ).
8
+
3
9
## [ 11.12.0] ( https://github.com/Instabug/Instabug-Flutter/compare/v11.10.1...v11.12.0 ) (May 30, 2023)
4
10
5
11
### Changed
Original file line number Diff line number Diff line change 8
8
import com .instabug .bug .BugReporting ;
9
9
import com .instabug .flutter .generated .BugReportingPigeon ;
10
10
import com .instabug .flutter .util .ArgsRegistry ;
11
+ import com .instabug .flutter .util .ThreadManager ;
11
12
import com .instabug .library .Feature ;
12
13
import com .instabug .library .OnSdkDismissCallback ;
13
14
import com .instabug .library .extendedbugreport .ExtendedBugReport ;
@@ -132,9 +133,17 @@ public void bindOnInvokeCallback() {
132
133
BugReporting .setOnInvokeCallback (new OnInvokeCallback () {
133
134
@ Override
134
135
public void onInvoke () {
135
- flutterApi .onSdkInvoke (new BugReportingPigeon .BugReportingFlutterApi .Reply <Void >() {
136
+ // The on invoke callback for Flutter needs to be run on the
137
+ // main thread, otherwise, it won't work and will break the
138
+ // Instabug.show API
139
+ ThreadManager .runOnMainThread (new Runnable () {
136
140
@ Override
137
- public void reply (Void reply ) {
141
+ public void run () {
142
+ flutterApi .onSdkInvoke (new BugReportingPigeon .BugReportingFlutterApi .Reply <Void >() {
143
+ @ Override
144
+ public void reply (Void reply ) {
145
+ }
146
+ });
138
147
}
139
148
});
140
149
}
Original file line number Diff line number Diff line change 1
1
package com .instabug .flutter .util ;
2
2
3
3
import android .os .AsyncTask ;
4
+ import android .os .Handler ;
5
+ import android .os .Looper ;
4
6
5
7
public class ThreadManager {
6
8
// TODO: migrate to Flutter's TaskQueue
7
9
public static void runOnBackground (Runnable runnable ) {
8
10
AsyncTask .execute (runnable );
9
11
}
12
+
13
+ public static void runOnMainThread (Runnable runnable ) {
14
+ new Handler (Looper .getMainLooper ()).post (runnable );
15
+ }
10
16
}
You can’t perform that action at this time.
0 commit comments