Skip to content

Commit a48a8de

Browse files
committed
update Readme
1 parent fde8f26 commit a48a8de

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

e2e/android/app/src/main/java/com/example/androidobservability/BaseApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ open class BaseApplication : Application() {
5454
privacyProfile = PrivacyProfile(
5555
maskText = false,
5656
maskViews = listOf(view(ImageView::class.java)),
57-
maskXMLViewIds = listOf("@+id/smoothieTitle"))
57+
maskXMLViewIds = listOf("smoothieTitle"))
5858
)
5959
)
6060

sdk/@launchdarkly/observability-android/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Add the Session Replay plugin **after** Observability when configuring the Launc
202202

203203
```kotlin
204204
import com.launchdarkly.observability.plugin.Observability
205-
import com.launchdarkly.observability.replay.SessionReplay
205+
import com.launchdarkly.observability.replay.plugin.SessionReplay
206206

207207
val ldConfig = LDConfig.Builder(LDConfig.Builder.AutoEnvAttributes.Enabled)
208208
.mobileKey("your-mobile-key")
@@ -225,6 +225,39 @@ Notes:
225225

226226
Use `ldMask()` to mark views that should be masked in session replay. There are helpers for both XML-based Views and Jetpack Compose.
227227

228+
##### Configure masking via `PrivacyProfile`
229+
230+
If you want to configure masking globally (instead of calling `ldMask()` on each element), pass a `PrivacyProfile` to `ReplayOptions`:
231+
232+
```kotlin
233+
import com.launchdarkly.observability.replay.PrivacyProfile
234+
import com.launchdarkly.observability.replay.ReplayOptions
235+
import com.launchdarkly.observability.replay.view
236+
import com.launchdarkly.observability.replay.plugin.SessionReplay
237+
238+
val sessionReplay = SessionReplay(
239+
ReplayOptions(
240+
privacyProfile = PrivacyProfile(
241+
// New settings:
242+
maskViews = listOf(
243+
// Masks targets by *exact* Android View class (does not match subclasses).
244+
view(android.widget.ImageView::class),
245+
),
246+
maskXMLViewIds = listOf(
247+
// Masks by resource entry name (from resources.getResourceEntryName(view.id)).
248+
// Accepts either "@+id/foo" or "foo".
249+
"@+id/password",
250+
"credit_card_number",
251+
),
252+
)
253+
)
254+
)
255+
```
256+
257+
Notes:
258+
- `maskViews` matches on `target.view.javaClass` equality (exact class only).
259+
- `maskXMLViewIds` applies only to Views with a non-`View.NO_ID` id that resolves to a resource entry name.
260+
228261
##### XML Views
229262

230263
Import the masking API and call `ldMask()` on any `View` (for example, after inflating the layout in an `Activity` or `Fragment`).

0 commit comments

Comments
 (0)