Preferences object provides settings that are preferred by the user. These preferences can differ from the settings the SDK uses when recording.
State object 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 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.
// returns type RecordingStatus = "Recording" | "NotStarted" | "Stopped" | "BellowMinSdkVersion" | "ProjectLimitReached" | "StorageLimitReached" | "InternalError" | "NotRunningInSwiftUIContext" | "UnsupportedPlatform" const recordingStatus = await Smartlook.instange.state.getRecordingStatus();
If the SDK is recording, you get
SmartlookRecordingStatus.Recording. If the SDK is not recording, you get one of the possible causes:
|The recording has not started yet.|
|The recording was stopped using |
|The SDK is installed on an unsupported Android SDK version.|
|The project limit of recorded sessions has been reached.|
|The SDK cannot record because it would violate storage limits.|
|The SDK stopped recording due to an internal error.|
|The SDK is not properly integrated with SwiftUI.|
|The SDK is installed on an unsupported iOS version.|
A unique project key is needed for the SDK to upload and process recordings.
Smartlook.instance.preferences.setProjectKey( 'your-unique-project-key' );
Unique project key
You can find your project key in the mobile project settings on the Smartlook dashboard.
const projectKey = await Smartlook.instance.state.getProjectKey();
The project key is not defined by default (set to
Set the preferred frame rate recorded by the SDK. Only settings between
10 frames per second are allowed.
Frame rate set through API
If you set a frame rate between
10frames per second using the API, any settings that are set from the dashboard are ignored.
const frameRate = await Smartlook.instance.preferences.getFrameRate();
The default frame rate used by the SDK is 2 frames per second.
The SDK can use different methods of capturing screen image data. These are called rendering modes. For more information, see Rendering modes.
By default, recording of
TextureView on Android is not enabled. You can enable it using
const isSurfaceRecordingEnabled = await Smartlook.instance.state.getSurfaceCaptureEnabled();
By default, surfaces are not recorded, thus the default value is set to
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
TextureView on Android, or similar is used. Thus adaptive frame rate can be disabled.
Adaptive frame rate
Due to reported issues with video responsiveness on iOS, we recommend turning off the
Adaptive Frame Ratefeature, e.g.
const isAdaptiveFrameRateEnabled = await Smartlook.instance.preferences.getAdaptiveFrameRateEnabled();
By default, adaptive frame rate is enabled, thus the default value is
Tracking of some automatically tracked events can be enabled or disabled using Event Tracking API.
All automatically detected navigation events can be enabled or disabled. Or,
Fragment detection can be enabled or disabled separately on Android.
// Android only properties Smartlook.instance.preferences.eventTrackingNavigationEnableAll(); Smartlook.instance.preferences.eventTrackingNavigationDisableAll(); Smartlook.instance.preferences.setEventTrackingNavigationActivityStatus(true|false); Smartlook.instance.preferences.setEventTrackingNavigationFragmentStatus(true|false);
Fragmentnavigation event detection is disabled by default.
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.instance.preferences.setEventTrackingInteractionUserStatus(true|false); Smartlook.instance.preferences.setEventTrackingInteractionRageClickStatus(true|false); // Android only properties Smartlook.instance.preferences.setEventTrackingInteractionEnableAll(); Smartlook.instance.preferences.setEventTrackingInteractionDisableAll();
By default , all automatically detected events are tracked, except
Fragmentnavigation events on Android.
The default can be restored using the following: