Instabug

Integration

Installation

This section explains how to install Instabug SDK into your Cordova application.
Open the command line and navigate to your project directory. Then run the following command.

cordova plugin add https://github.com/Instabug/instabug-cordova

Using Instabug

iOS

To start using Instabug, you will need to initialize the SDK in your app. This can be done through the activate method. It takes as parameter your app token, the desired invocation event and a range of optional parameters. It takes 2 callback functions, one for the success and another one in the case of failure.

App token

To find your application token, open you Instabug dashboard. Select an application. Then, open the SDK tab.

Invocation Event

Using this parameter you specify how your users will invoke the SDK to send you a report. For more details about the invocation check this link.

Like the app token, the value itself can be provided, or you can give an object with values according to platforms.

Optional Parameters

A third parameter is an optional object containing properties to set a variety of configurations.
Here is a sample code showing how to use Instabug.

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

Android

To start using the SDK in your Android app, change the name of the application class in your AndroidManifest.xml file to android:name="com.instabug.cordova.plugin.MyApplication". Then, you only need to add your app token in the MyApplication class, by replacing YOUR_ANDROID_TOKEN by your app token.
You can find this class under this path YourProjectName/plugins/com.instabug.cordova.plugin/src/android/MyApplication.java

To find your application token, open you Instabug dashboard. Select an application. Then, open the SDK tab.

Integration