Skip to content

Commit

Permalink
Merge pull request #217 from scootnetworks/fix_android_thread_issue
Browse files Browse the repository at this point in the history
Android crashes when calling setInvocationEvent() from Javascript
  • Loading branch information
salmamali authored Dec 11, 2018
2 parents 0c08a02 + 8cb4ee6 commit 995d6cb
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -807,12 +807,17 @@ public void getUnreadMessagesCount(Callback messageCountCallback) {
* @see InstabugInvocationEvent
*/
@ReactMethod
public void setInvocationEvent(String invocationEventValue) {
try {
BugReporting.setInvocationEvents(getInvocationEventById(invocationEventValue));
} catch (Exception e) {
e.printStackTrace();
}
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();
}
}
});
}

/**
Expand Down

0 comments on commit 995d6cb

Please sign in to comment.