SDK 12.1.0 Migration Guide forReact Native
Guide for migrating to Instabug's SDK version 12.0 on React Native
With the release of version 12.1.0, a whole host of new products have been released such as, Session Replay, App Ratings, and Rollout Management. Along with this release, a few APIs have been changed to better suit these new features and in order to improve the usage of these APIs.
Initializing the SDK
If you're using Instabug.start
to initialize the Instabug SDK, you'll need to migrate to the new Instabug.init
method introduced in v11.9.0
.
Before
Instabug.start('<APP_TOKEN>', [InvocationEvent.shake]);
Instabug.setSdkDebugLogsLevel(Instabug.sdkDebugLogsLevel.sdkDebugLogsLevelVerbose);
After
Instabug.init({
token: '<APP_TOKEN>',
invocationEvents: [InvocationEvent.shake],
debugLogsLevel: LogLevel.verbose,
});
Removed APIs & Alternatives
Deprecated API | Corresponding API |
---|---|
Instabug.start | Instabug.init |
Instabug.setSdkDebugLogsLevel | Instabug.init 's debugLogsLevel parameter. |
Instabug.setDebugEnabled | Instabug.init 's debugLogsLevel parameter |
Instabug.setReproStepsMode | Instabug.setReproStepsConfig |
Instabug.enable | Instabug.setEnabled(true) |
Instabug.disable | Instabug.setEnabled(false) |
Instabug.isRunningLive | You can manage and check your app running environment using environment variables. |
Instabug.setPrivateView | Instabug.addPrivateView |
Instabug.callPrivateApi | Removed. |
CrashReporting.reportJSException | CrashReporting.reportError |
APM.setLogLevel | Instabug.init 's debugLogsLevel parameter |
StringKey.discardAlertAction | StringKey.discardAlertStay and StringKey.discardAlertDiscard |
StringKey.discardAlertCancel | StringKey.discardAlertStay and StringKey.discardAlertDiscard |
StringKey.invalidCommentMessage | StringKey.insufficientContentMessage |
StringKey.invalidCommentTitle | StringKey.insufficientContentTitle |
StringKey.reproStepsListItemTitle | StringKey.reproStepsListItemNumberingTitle |
Using Promises instead of Callbacks
The below APIs previously had a callback parameter which is invoked with the result. Since then, we've migrated them to use Promises
instead for convenience.
Instabug.getTags
Instabug.getUserAttribute
Instabug.getAllUserAttributes
Replies.hasChats
Replies.getUnreadRepliesCount
Surveys.getAvailableSurveys
Surveys.hasRespondedToSurvey
You can use the returned Promise
as follows:
const tags = await Instabug.getTags();
Removed Enums
All the enums that were available as properties under modules similar to Instabug.invocationEvent
and BugReporting.option
have been deprecated and removed in favor of the new standalone enums introduced in v11.9.0.
Here is the full list of removed enums and their alternatives:
Removed | Alternative |
---|---|
Instabug.invocationEvent | InvocationEvent |
Instabug.reproStepsMode | ReproStepsMode |
Instabug.dismissType | DismissType |
Instabug.sdkDebugLogsLevel | LogLevel |
Instabug.extendedBugReportMode | ExtendedBugReportMode |
Instabug.locale | Locale |
Instabug.colorTheme | ColorTheme |
Instabug.floatingButtonEdge | FloatingButtonPosition |
Instabug.IBGPosition | RecordingButtonPosition |
Instabug.welcomeMessageMode | WelcomeMessageMode |
Instabug.actionTypes | ActionType |
Instabug.strings | StringKey |
FeatureRequests.actionTypes | ActionType |
BugReporting.invocationEvent | InvocationEvent |
BugReporting.extendedBugReportMode | ExtendedBugReportMode |
BugReporting.reportType | ReportType |
BugReporting.option | InvocationOption |
BugReporting.position | RecordingButtonPosition |
APM.logLevel | LogLevel and the debugLogsLevel in Instabug.init ’s config. |
Updated about 1 year ago