Preferences and State

Preferences

Preferences are settings that are preferred by the user. These preferences can differ from the settings the SDK uses when recording.

State

Calling State provides settings that are currently used by the SDK. The state of every SDK setting is based on:

  • Default SDK settings.
  • Settings retrieved from the backend.
  • Preferences specified through the API .

Status

Because status is read-only, you can only get it using state. It can be used to check if the SDK is currently recording. It can also provide additional information about why the SDK is not recording.

const recordingStatus = await Smartlook.getRecordingStatus();

If the SDK is recording, you get RecordingStatus.Recording. If the SDK is not recording, you get one of the possible causes:

StatusPossible Cause
RecordingStatus.NotStartedThe recording has not started yet.
RecordingStatus.StoppedThe recording was stopped using stop().
RecordingStatus.BellowMinSdkVersionThe SDK is installed on an unsupported Android SDK version.
RecordingStatus.ProjectLimitReachedThe project limit of recorded sessions has been reached.
RecordingStatus.StorageLimitReachedThe SDK cannot record because it would violate storage limits.
RecordingStatus.InternalErrorThe SDK stopped recording due to an internal error.
RecordingStatus.NotRunningInSwiftUIContextThe SDK is not properly integrated with SwiftUI.
RecordingStatus.UnsupportedPlatformThe SDK is installed on an unsupported iOS version.

Default value

The default status is RecordingStatus.NotStarted.

Project key

A unique project key is needed for the SDK to upload and process recordings.

Set the project key

Smartlook.setProjectKey({
  key: 'your-unique-project-key'
});

πŸ“˜

Unique project key

You can find your project key in the mobile project settings in the Smartlook app.

Read the project key

const projectKey = await Smartlook.getProjectKey();

Default value

The project key is not defined by default (set to null).

Frame rate

Set the preferred frame rate recorded by the SDK. Only settings between 2 and 10 frames per second are allowed.

🚧

Frame rate set through API

If you set a frame rate between 2 and 10 frames per second using the API, any settings that are set from the dashboard are ignored.

Set the framerate

Smartlook.setFrameRate({ frameRate: 2 });

Read the framerate

const framerate = await Smartlook.getFrameRate();

Default value

The default frame rate used by the SDK is 2 frames per second.

Rendering modes

The SDK can use different methods of capturing screen image data. These are called rendering modes. For more information, see Rendering modes.

Adaptive frame rate

To lower requirements on the CPU, storage space, and network bandwidth, the SDK captures the screen only when there is something drawn in the application. This detection works well in typical native applications, but might be problematic when Surface, TextureView on Android, or similar is used. Thus adaptive frame rate can be disabled.

Set adaptive frame rate

Smartlook.setAdaptiveFrameRateEnabled({ isEnabled: false });

πŸ“˜

Adaptive frame rate

Due to reported issues with video responsiveness on iOS, we recommend turning off the Adaptive Frame Rate feature, e.g. Smartlook.setAdaptiveFrameRateEnabled({ isEnabled: false });.

Read adaptive frame rate

const isAdaptiveFrameRateEnabled = await Smartlook.getAdaptiveFrameRateEnabled();

Default value

By default, adaptive frame rate is enabled, thus the default value is true.

Event tracking

Tracking of some automatically tracked events can be enabled or disabled using Event Tracking API.

All automatically detected events

Smartlook.eventTrackingEnableAll();
Smartlook.eventTrackingDisableAll();

User interaction events

All automatically detected user interaction events can be enabled or disabled. Or, rage click and touch event detection can be enabled and disabled separately.

Smartlook.setEventTrackingInteractionUserStatus({ isEnabled: true|false });
Smartlook.setEventTrackingInteractionRageClickStatus({ isEnabled: true|false });

Default value

The default can be restored using the following:

Smartlook.restoreDefault();