Bug Reporting Callbacks

Covered here are callbacks that you can use to have a block of code executed when a certain action is triggered for your Android apps.

Avoiding Memory Leaks

Before Invoking Luciq

This block is executed on the UI thread. You can use it to perform any UI changes before the SDK's UI is shown.

BugReporting.setOnInvokeCallback {
					 //do something
        }

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. You can also use this API to run some logic after the bug is reported and before it gets synced with the backend, in case you need to access some data to take specific actions.

Available Data: tags, consoleLog, filesAttachments, userAttributes, userData, appending data to consoleLog, attaching files, and adding tags.

Luciq.onReportSubmitHandler{report -> }

By writing report. in the callback, the IDE autocomplete feature will show all of the mentioned operations that you can do or access on the report automatically.

After Dismissing Luciq

This block is executed on the UI thread. You can use it to perform any UI changes after the SDK's UI has been dismissed.

BugReporting.setOnDismissCallback { issueState, reportType -> }

You can find the following parameters within the setOnDismissCallback callback.

DismissType

Returns how the SDK was dismissed. It can be set to one of the three following possibilities:

  • SUBMIT: Indicates that the issue was submitted and will be uploaded

  • CANCEL: Indicates that the user closed the Luciq view without report submission

  • ADD_ATTACHMENT: Indicates that the issue is in the process of being reported (for example, user is taking another screenshot)

ReportType

The type of report that was sent. If the SDK was dismissed without selecting a report type, it will be set to bug, so you might need to check issueState before ReportType. The possible different types are bug, feedback, question, and other.

Disabling Callbacks

To disable any previously created callbacks, you'll simply need to set the method to null as shown below:

Last updated