make setInvocationEvent threadsafe
@@ -807,13 +807,18 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* @see InstabugInvocationEvent
*/
@ReactMethod
- public void setInvocationEvent(String invocationEventValue) {
+ public void setInvocationEvent(final String invocationEventValue) {
+ new Handler(Looper.getMainLooper()).post(new Runnable() {
+ @Override
+ public void run() {
try {
BugReporting.setInvocationEvents(getInvocationEventById(invocationEventValue));
} catch (Exception e) {
e.printStackTrace();
}
}
+ });
+ }
/**
* Sets the event used to invoke Instabug SDK
