HomeDocumentationAPI Reference
Getting StartedAPI ReferenceHelp CenterVideo Tours

SDK 11.0 Migration Guide

This page covers the migration steps from previous versions of the SDK to Instabug Version 11.0+ for Cordova and Ionic apps.

Importing the Plugin

Prior to v11, Instabug modules were polluting the plugins object and may clash with other libraries (thanks to Edmu for highlighting it here)

So instead of using the modules like this:

cordova.plugins.bugReporting.setEnabled(...);

Now you can use it with cordova.require as follows:

var BugReporting = cordova.require("instabug-cordova.BugReporting");

BugReporting.setEnabled(...);

Or if you prefer to use the window object:

var BugReporting = window.InstabugLib.BugReporting;

Available Modules

Module

Using cordova.require (Recommended)

Using window

Instabug

cordova.require("instabug-cordova.Instabug")

window.InstabugLib.Instabug

BugReporting

cordova.require("instabug-cordova.BugReporting")

window.InstabugLib.BugReporting

FeatureRequests

cordova.require("instabug-cordova.FeatureRequests

window.InstabugLib.FeatureRequests

Surveys

cordova.require("instabug-cordova.Surveys

window.InstabugLib.Surveys

Replies

cordova.require("instabug-cordova.Replies

window.InstabugLib.Replies

Start the SDK from JS only

Users are now able to initialize the SDK completely from Javascript rather than having to write the initialization code for Android in the Java/Kotlin files.

Migrate the initialization code to JS

  1. If you have checked platform/android in your source control, then remove the following attribute from platforms/android/app/src/main/AndroidManifest.xml:
android:name="com.instabug.cordova.plugin.MyApplication"
  1. Initialize Instabug in your JS, inside the onDeviceReady function, by replacing calls for Instabug.activate with Instabug.start
function onDeviceReady() {
  var Instabug = cordova.require("instabug-cordova.Instabug");
  var BugReporting = cordova.require("instabug-cordova.BugReporting");

  Instabug.start(
    'APP_TOKEN',
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
  );
}
import { Instabug, BugReporting } from "instabug-cordova";

Instabug.start(
    'APP_TOKEN',
    [BugReporting.invocationEvents.button],
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);
  1. Replace Instabug.activate options with the alternative JS API:

Key

Alternative JS API

shakingThresholdIPhone

BugReporting.setShakingThresholdForiPhone

shakingThresholdIPad

BugReporting.setShakingThresholdForiPad

floatingButtonEdge
floatingButtonOffset

BugReporting.setFloatingButtonEdge

enableSessionProfiler

Instabug.setSessionProfilerEnabled

colorTheme

Instabug.setColorTheme

welcomeMessageMode

Instabug.setWelcomeMessageMode

Remove the deprecated APIs

BugReporting Module

Removed

Alternative

invocationOptions enum

option enum

setInvocationOptions

setOptions

Chats Module

Completely removed. Use Replies Module instead.

Instabug Module

Removed

Alternative

startWithToken

start

activate

start

getUnreadMessagesCount

Replies.getUnreadRepliesCount

setChatNotificationEnabled

Replies.setInAppNotificationEnabled

Breaking Changes

Some APIs were removed or moved to another module:

  1. Remove Instabug.setAutoScreenRecordingMaxDuration
  2. Remove Surveys.setThresholdForReshowingSurveyAfterDismiss
  3. Remove Instabug.setViewHierarchyEnabled
  4. Remove BugReporting.invocationModes enum.
  5. Replace Instabug.setVideoRecordingFloatingButtonPosition with BugReporting.setVideoRecordingFloatingButtonPosition
  6. Replace Instabug.setShakingThreshold with BugReporting.setShakingThresholdForAndroid