Android SESSION REPLAY¶
Prerequisites¶
- Ensure you have set up and initialized the FTSdk RUM configuration, and enabled View monitoring collection.
- Android Session Replay is currently an alpha feature, requiring the use of
ft-sdk:1.7.0
or higher versions.
Configuration¶
// Add SDK dependency
implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-sdk:[latest_version]
// Enable session replay functionality
implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-session-replay:[latest_version]'
// Support for session replay requires material component support
implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-session-replay-material:[latest_version]'
Code Invocation¶
Method Name | Type | Required | Description |
---|---|---|---|
setSampleRate | Float | No | Sets the sampling rate, with a range of [0,1], where 0 indicates no collection and 1 indicates full collection. The default value is 1. |
setSessionReplayOnErrorSampleRate | Float | No | Sets the error collection rate; when the session is not sampled by setSampleRate , if an error occurs during the session, data within one minute before the error can be collected. The value range is [0,1], where 0 indicates no collection and 1 indicates full collection. The default value is 0. Supported in ft-session-replay version 0.1.2-alpha01 and above. |
setPrivacy | SessionReplayPrivacy | No | SessionReplayPrivacy.ALLOW does not mask private data, SessionReplayPrivacy.MASK masks all data including text, CheckBoxes, RadioButtons, Switches; SessionReplayPrivacy.USER_INPUT (recommended) masks some user input data including text in input fields, CheckBoxes, RadioButtons, Switches. The default is SessionReplayPrivacy.MASK . This method is soon to be deprecated, it's recommended to use setTouchPrivacy and setTextAndInputPrivacy for masking settings. |
setTextAndInputPrivacy | TextAndInputPrivacy | No | TextAndInputPrivacy.MASK_SENSITIVE_INPUTS only masks password-like information, TextAndInputPrivacy.MASK_ALL_INPUTS masks some user input data including text in input fields, CheckBoxes, RadioButtons, Switches, TextAndInputPrivacy.MASK_ALL , masks all data including text, CheckBoxes, RadioButtons, Switches. Default is TextAndInputPrivacy.MASK_ALL . After setting this, it overrides the configuration set by setPrivacy . Supported in ft-session-replay version 0.1.1-alpha01 and above. |
setTouchPrivacy | TouchPrivacy | No | TouchPrivacy.SHOW does not mask touch data, TouchPrivacy.HIDE masks touch data. After setting this, it overrides the configuration set by setPrivacy . Supported in ft-session-replay version 0.1.1-alpha01 and above. |
addExtensionSupport | ExtensionSupport | No | Adds additional custom support. Using ft-session-replay-material allows using MaterialExtensionSupport to provide extra material component collection support. |
Privacy Overrides¶
Supported in
ft-session-replay
version 0.1.1-alpha01 and above.
In addition to supporting global privacy masking level configurations through FTSessionReplayConfig
, the SDK also supports overriding these settings at the view level.
View-level privacy overrides:
- Supports overriding text and input masking levels as well as touch data masking levels.
- Supports setting complete hiding for specific views.
Note:
- To ensure correct recognition of override settings, they should be applied as early as possible in the view lifecycle. This prevents Session Replay from processing views before the application of override settings.
- Privacy overrides affect the view and its subviews. This means that even if the override is applied to a view that might not immediately take effect (for example, applying image overrides on text inputs), the override will still apply to all subviews.
- Priority of privacy overrides: Subviews > Parent Views > Global Settings
Text and Input Overrides¶
To override text and input privacy, use PrivacyOverrideExtensions.setSessionReplayTextAndInputPrivacy(View,TextAndInputPrivacy)
on the view instance to set it to one of the values in the TextAndInputPrivacy
enumeration. To remove existing override rules, simply set this property to null
.
Touch Overrides¶
To override touch privacy, use PrivacyOverrideExtensions.setSessionReplayTouchPrivacy(View,TouchPrivacy)
on the view instance to set it to one of the values in the TouchPrivacy
enumeration. To remove existing override rules, simply set this property to null
.
Hidden Element Overrides¶
For sensitive elements that need to be completely hidden, use PrivacyOverrideExtensions.setSessionReplayHidden(View,Boolean)
to set them.
When an element is marked as hidden, it will be replaced with a "Hidden" placeholder in the replay, and its subviews will not be recorded.
Note: Marking a view as hidden will not prevent recording of touch interactions on that element. To hide touch interactions, in addition to marking the element as hidden, you must also use Touch Overrides.
Jetpack Compose Support¶
Currently, there is no support for Session Replay recording of Jetpack Compose related interfaces.