Bug Reporting

This page covers some APIs specific for Cordova 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.

cordova.plugins.instabug.activate(
    {
        android: 'MY_ANDROID_TOKEN',
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
        emailRequired: true
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

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.

cordova.plugins.instabug.activate(
    {
        android: 'MY_ANDROID_TOKEN',
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
        commentRequired: true
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

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.

cordova.plugins.bugReporting.setOnInvokeHandler(
            function () {
                //Add any logic you want to do here
                console.log('On invocation logic');
            },
            function (error) {
                console.log('On Invoke handler could not be set ' + error);
            }
        );

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.

cordova.plugins.bugReporting.setOnDismissHandler(
            function () {
                //Add any logic you want to do here
                console.log('Invocation dismiss logic');
            },
            function (error) {
                console.log('Invoke dismiss handler could not be set ' + error);
            }
        );

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.

cordova.plugins.bugReporting.setPromptOptions(
            [cordova.plugins.bugReporting.invocationModes.chat, cordova.plugins.bugReporting.invocationModes.feedback],
            function () {
                console.log('Prompt options set successfully');
            },
            function (error) {
                console.log('Prompt options set unsuccessful  ' + error);
            }
        );

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