HomeDocumentationAPI Reference
Getting StartedAPI ReferenceBug ReportingCrash ReportingAPMHelp Center
These docs are for v8.2. Click to read the latest docs for v12.0.0.

Callbacks

Covered here is how to set up the callbacks that fire before every crash report is sent so that a specific block of code is executed.

🚧

Avoiding Memory Leaks

These APIs hold the callbacks in a strong reference, so we strongly suggest to avoid registering callbacks without unregistering them when needed, as it may cause a memory leak.

Before Sending a Report

This block is executed in the background before sending each report. You can use it to attach logs and extra data to reports.

Instabug.onReportSubmitHandler(new Runnable() {
  @Override
  public void run() {
    // Attach logs and extra data to reports.
  }
});

What’s Next

You can set custom data, such as a user attribute, at any time, including inside callbacks. Logging user events in callbacks is possible as well.