Crash Reporting Callbacks for Android

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 in your Android app.

🚧

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{report -> }
Instabug.onReportSubmitHandler(new Report.OnReportCreatedListener() {
            @Override
            public void onReportCreated(Report report) {
                
            }
        };

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.