Bug Reporting

This page covers some APIs specific for React-Native bug reporting.

We're covering bug reporting in this page. However, in the Reports Data section, you can find more information about the information and data sent with each bug report.

Required Fields

Email Address

Bug reports and feedback by default require users to enter a valid email address. To allow users to send bug reports and feedback without an email, use the following method.

BugReporting.setInvocationOptions([BugReporting.invocationOptions.emailFieldOptional]);

Comment

By default, users could send bug reports and feedback without entering a comment. To require users to enter a comment before they are able to send a bug report or feedback, use the following method.

BugReporting.setInvocationOptions([BugReporting.invocationOptions.commentFieldRequired]);

The image below shows the 1st view that your users will see while reporting a bug.

SDK Events

Before Showing the SDK

This block is executed on the UI thread. Could be used for performing any UI changes before the SDK's UI is shown.

BugReporting.OnInvokeHandler(function () {
    // Perform any UI changes before the SDK's UI is shown.
});

Before Sending a Report

This block is executed in the background before sending each report. Could be used for attaching logs and extra data to reports.

BugReporting.onReportSubmitHandler(function () {
    // Attach logs and extra data to reports.
});

After the SDK Has Been Dismissed

This block is executed on the UI thread. Could be used for performing any UI changes after the SDK's UI has been dismissed.

BugReporting.onSDKDismissedHandler(function (dismissType, reportType) {
    // Perform any UI changes after the SDK's UI has been dismissed.
});

The postInvocationHandler block has the following parameters:
dismissType: How the SDK was dismissed.
reportType: Type of report that has been sent. Will be set to IBGReportTypeBug in case the SDK has been dismissed without selecting a report type, so you might need to check issueState before reportType.

Disabling and Enabling

Bug reporting, feedback, and chats can be enabled or disabled separately. When the user invokes the SDK with any of the invocation events, a popup appears showing all the enabled features. When only a single option is enabled, it becomes the default invocation mode and the popup doesn't appear. If all options are disabled, bug reporting becomes the default invocation mode.

//Arguments: chat, bug, feedback
BugReporting.setPromptOptionsEnabled(true, false, true);

By default, all three options are enabled if they are available in your current plan.