Android SESSION REPLAY¶
Prerequisites¶
- Ensure you have set up and initialized the FTSdk RUM configuration, and enabled View monitoring.
- Android Session Replay is currently an alpha feature, requiring the use of
ft-sdk:1.7.0
or later versions.
Configuration¶
// Add SDK dependencies
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]'
// Material component support required for session replay
implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-session-replay-material:[latest_version]'
Code Invocation¶
Method Name | Type | Required | Meaning |
---|---|---|---|
setSampleRate | Float | No | Set the sampling rate, value range [0,1], 0 means no collection, 1 means full collection, default value is 1. |
setPrivacy | SessionReplayPrivacy | No | SessionReplayPrivacy.ALLOW does not mask privacy data, SessionReplayPrivacy.MASK masks all data including text, CheckBox, RadioButton, Switch; SessionReplayPrivacy.USER_INPUT (recommended) masks part of user input data including text in input fields, CheckBox, RadioButton, Switch. Default is SessionReplayPrivacy.MASK . Deprecated soon, can be used for compatibility, it is recommended to prioritize using setTouchPrivacy and setTextAndInputPrivacy for masking settings |
setTextAndInputPrivacy | TextAndInputPrivacy | No | TextAndInputPrivacy.MASK_SENSITIVE_INPUTS only masks password information, TextAndInputPrivacy.MASK_ALL_INPUTS masks part of user input data including text in input fields, CheckBox, RadioButton, Switch, TextAndInputPrivacy.MASK_ALL , masks all data including text, CheckBox, RadioButton, Switch. Default is TextAndInputPrivacy.MASK_ALL . This setting overrides setPrivacy configuration, 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. This setting overrides setPrivacy configuration, supported in ft-session-replay version 0.1.1-alpha01 and above. |
addExtensionSupport | ExtensionSupport | No | Add extra custom support. Use ft-session-replay-material to enable MaterialExtensionSupport which provides additional material component collection support. |
Privacy Override¶
Supported in
ft-session-replay
version 0.1.1-alpha01 and above.
In addition to supporting global masking level configuration via FTSessionReplayConfig
, the SDK also supports overriding these settings at the view level.
View-level privacy override:
- Supports overriding text and input masking levels as well as touch masking levels.
- Supports setting specific views to be completely hidden.
Note:
- To ensure correct recognition of override settings, they should be applied as early as possible in the view lifecycle. This prevents the Session Replay from processing the view before the application of the override settings.
- Privacy overrides affect the view and its subviews. This means that even if the override is applied to a view that may not take immediate effect (e.g., applying image overrides to 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 and set it to one of the values in the TextAndInputPrivacy
enumeration. If you need 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 and set it to one of the values in the TouchPrivacy
enumeration. If you need to remove existing override rules, simply set this property to null
.
Hidden Element Overrides¶
For sensitive elements that need to be fully hidden, use PrivacyOverrideExtensions.setSessionReplayHidden(View,Boolean)
for setting.
When an element is marked as hidden, it will be replaced by a "Hidden" placeholder during replay, and its subviews will not be recorded.
Note: Marking a view as hidden will not prevent recording touch interactions on that element. To hide touch interactions, in addition to marking the element as hidden, use Touch Overrides.
Jetpack Compose Support¶
Currently, there is no support for Session Replay recording of Jetpack Compose related interfaces.