SDK 12.1.0 Migration Guide forReact Native
Guide for migrating to Luciq'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 Luciq.start to initialize the Luciq SDK, you'll need to migrate to the new Luciq.init method introduced in v11.9.0.
Before
Luciq.start('<APP_TOKEN>', [InvocationEvent.shake]);
Luciq.setSdkDebugLogsLevel(Luciq.sdkDebugLogsLevel.sdkDebugLogsLevelVerbose);
After
Luciq.init({
token: '<APP_TOKEN>',
invocationEvents: [InvocationEvent.shake],
debugLogsLevel: LogLevel.verbose,
});
Removed APIs & Alternatives
| Deprecated API | Corresponding API |
|---|---|
Luciq.start | Luciq.init |
Luciq.setSdkDebugLogsLevel | Luciq.init's debugLogsLevel parameter. |
Luciq.setDebugEnabled | Luciq.init's debugLogsLevel parameter |
Luciq.setReproStepsMode | Luciq.setReproStepsConfig |
Luciq.enable | Luciq.setEnabled(true) |
Luciq.disable | Luciq.setEnabled(false) |
Luciq.isRunningLive | You can manage and check your app running environment using environment variables. |
Luciq.setPrivateView | Luciq.addPrivateView |
Luciq.callPrivateApi | Removed. |
CrashReporting.reportJSException | CrashReporting.reportError |
APM.setLogLevel | Luciq.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.
Luciq.getTags
Luciq.getUserAttribute
Luciq.getAllUserAttributes
Replies.hasChats
Replies.getUnreadRepliesCount
Surveys.getAvailableSurveys
Surveys.hasRespondedToSurvey
You can use the returned Promise as follows:
const tags = await Luciq.getTags();
Removed Enums
All the enums that were available as properties under modules similar to Luciq.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 |
|---|---|
Luciq.invocationEvent | InvocationEvent |
Luciq.reproStepsMode | ReproStepsMode |
Luciq.dismissType | DismissType |
Luciq.sdkDebugLogsLevel | LogLevel |
Luciq.extendedBugReportMode | ExtendedBugReportMode |
Luciq.locale | Locale |
Luciq.colorTheme | ColorTheme |
Luciq.floatingButtonEdge | FloatingButtonPosition |
Luciq.LCQPosition | RecordingButtonPosition |
Luciq.welcomeMessageMode | WelcomeMessageMode |
Luciq.actionTypes | ActionType |
Luciq.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 Luciq.init’s config. |
Updated about 2 months ago
