Android SESSION REPLAY¶
Prerequisites¶
- Ensure that you have set up and initialized the FTSdk RUM configuration and enabled View monitoring collection.
- Android Session Replay is currently an alpha feature and requires using
ft-sdk:1.7.0
or above. - It is recommended to use the version displayed in the badge at the top of the document. Additionally, you can find the available alpha versions through the following commands. The alpha version changelogs are available in ft-sdk, ft-ft-session-replay, and ft-session-replay-material.
#ft-sdk alpha version
curl https://mvnrepo.jiagouyun.com/repository/maven-releases/com/cloudcare/ft/mobile/sdk/tracker/agent/ft-sdk/maven-metadata.xml | grep alpha
#ft-session-replay alpha version
curl https://mvnrepo.jiagouyun.com/repository/maven-releases/com/cloudcare/ft/mobile/sdk/tracker/agent/ft-session-replay/maven-metadata.xml | grep alpha
#ft-session-replay-material alpha version
curl https://mvnrepo.jiagouyun.com/repository/maven-releases/com/cloudcare/ft/mobile/sdk/tracker/agent/ft-session-replay-material/maven-metadata.xml | grep alpha
Configuration¶
// Add SDK dependencies
implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-sdk:[latest_alpha_version]
// Enable session replay feature
implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-session-replay:[latest_alpha_version]'
// Support for session replay requires material components
implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-session-replay-material:[latest_alpha_version]'
Code Sample¶
Method Name | Type | Required | Description |
---|---|---|---|
setSampleRate | Float | No | Set the sampling rate, range [0,1], 0 means no sampling, 1 means full sampling, default is 1. |
setSessionReplayOnErrorSampleRate | Float | No | Set the error sampling rate. When a session is not sampled by setSampleRate , if an error occurs during the session, data from the 1 minute before the error can be sampled. Range [0,1], 0 means no sampling, 1 means full sampling, default is 0. Supported in ft-session-replay 0.1.2-alpha01 and above. |
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 the user input data, including text in input boxes, CheckBox, RadioButton, Switch. Default is SessionReplayPrivacy.MASK . Deprecated, compatible for use, but it is recommended to use setTouchPrivacy and setTextAndInputPrivacy for masking settings |
setTextAndInputPrivacy | TextAndInputPrivacy | No | TextAndInputPrivacy.MASK_SENSITIVE_INPUTS only masks sensitive information like passwords, TextAndInputPrivacy.MASK_ALL_INPUTS masks part of the user input data, including text in input boxes, CheckBox, RadioButton, Switch, TextAndInputPrivacy.MASK_ALL , masks all data, including text, CheckBox, RadioButton, Switch. Default is TextAndInputPrivacy.MASK_ALL . This setting overrides the configuration of setPrivacy . Supported in ft-session-replay 0.1.1-alpha01 and above. |
setTouchPrivacy | TouchPrivacy | No | TouchPrivacy.SHOW does not mask touch data, TouchPrivacy.HIDE masks touch data. This setting overrides the configuration of setPrivacy . Supported in ft-session-replay 0.1.1-alpha01 and above. |
addExtensionSupport | ExtensionSupport | No | Add additional custom support. Using ft-session-replay-material allows MaterialExtensionSupport to provide additional Material component collection support. |
Privacy Override¶
Supported in
ft-session-replay
0.1.1-alpha01 and above.
In addition to supporting global masking levels through FTSessionReplayConfig
, the SDK also supports overriding these settings at the view level.
View-level privacy override:
- Supports overriding text and input masking levels and touch masking levels.
- Supports completely hiding specific views.
Note:
- To ensure that override settings are correctly recognized, they should be applied as early as possible in the view lifecycle. This prevents Session Replay from processing the view before the override settings are applied.
- Privacy overrides affect the view and its child views. This means that even if the override is applied to a view that may not take effect immediately (e.g., applying an image override to a text input), the override will still apply to all child views.
- Privacy override priority: Child view > Parent view > Global settings
Text and Input Override¶
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
enum. To remove an existing override rule, simply set the property to null
.
Touch Override¶
To override touch privacy, use PrivacyOverrideExtensions.setSessionReplayTouchPrivacy(View,TouchPrivacy)
on the view instance to set it to one of the values in the TouchPrivacy
enum. To remove an existing override rule, simply set the property to null
.
Hidden Element Override¶
For sensitive elements that need to be completely hidden, use PrivacyOverrideExtensions.setSessionReplayHidden(View,Boolean)
.
When an element is set to hidden, it will be replaced with a "Hidden" placeholder in the replay, and its child views will not be recorded.
Note: Marking a view as hidden does not prevent touch interactions on that element from being recorded. To hide touch interactions, in addition to marking the element as hidden, use Touch Override.
Jetpack Compose Support¶
Currently, Session Replay recording for Jetpack Compose related interfaces is not supported.