> For the complete documentation index, see [llms.txt](https://docs.luciq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luciq.ai/product-guides-and-integrations/product-guides/luciq-pii-masking/screen-and-screenshot-masking.md).

# Screen & Screenshot Masking

#### How masking works

Masking is applied on-device at screenshot-capture time, before the image is written to encrypted local storage or uploaded. Private regions are painted directly into the bitmap, so a raw, un-masked image is never stored or sent.

Two complementary controls are available and can be combined; manual marking stacks on top of the automatic type-based rules.

<table><thead><tr><th width="205.0859375">Control</th><th>When to use it</th><th>Scope</th></tr></thead><tbody><tr><td>Automatic (type-based)</td><td>A blanket “mask every view of type X” safety net</td><td>All views of the declared type(s), app-wide</td></tr><tr><td>Manual (per-view)</td><td>Surgical — this specific view or subtree contains PII</td><td>The view and all of its descendants</td></tr></tbody></table>

#### Defaults & minimum versions

| Item                                       | Default                                                                                            | Min SDK                                            |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| iOS auto type-based masking                | Disabled (maskNothing)                                                                             | iOS 11.12.0                                        |
| WebView masking (iOS & Android)            | On (WebViews masked)                                                                               | 19.3.0                                             |
| Auto masking in Jetpack Compose (Android)  | Enabled                                                                                            | 13.4.0                                             |
| Flutter auto masking                       | Disabled                                                                                           | <p>Luciq SDK - 18.0.0<br>Instabug SDK - 16.0.0</p> |
| Flutter private views (enablePrivateViews) | Enabled                                                                                            | <p>Luciq SDK - 18.0.0<br>Instabug SDK - 16.0.0</p> |
| Network key masking                        | Disabled                                                                                           | 14.2.0                                             |
| Repro Steps                                | Enabled Screenshots on for bug + session replay; off for crash (crash screenshots always disabled) | —                                                  |
| User Steps Privacy API                     | Disabled                                                                                           | <p>19.7.0 on Android<br>19.7.0 on iOS</p>          |

***

#### Automatic (type-based) masking

A single API call configures blanket rules applied to every screenshot the SDK captures. Available masking types:

<table><thead><tr><th valign="top">Constant</th><th valign="top">What it masks</th></tr></thead><tbody><tr><td valign="top">MASK_NOTHING</td><td valign="top">Disables all automatic masking</td></tr><tr><td valign="top">TEXT_INPUTS</td><td valign="top">Every text input field (EditText / Compose TextField, iOS UITextField / UITextView)</td></tr><tr><td valign="top">LABELS</td><td valign="top">Every text label / static text (TextView / Compose Text)</td></tr><tr><td valign="top">MEDIA</td><td valign="top">Every image or media view (ImageView / Compose Image)</td></tr><tr><td valign="top">WEB_VIEWS</td><td valign="top">Every WebView</td></tr></tbody></table>

**Android**

```
Luciq.setAutoMaskScreenshotsTypes(
    MaskingType.TEXT_INPUTS,
    MaskingType.LABELS,
    MaskingType.WEB_VIEWS   // keep the default on when overriding
);
```

**iOS**

```
Luciq.setAutoMaskScreenshots([.textInputs, .labels])
```

**ReactNative**

```
Luciq.enableAutoMasking(autoMaskingTypes: AutoMaskingType[])
// AutoMaskingType.labels | textInputs | media | none
```

**Flutter**

```
LuciqWidget(
  automasking: const [AutoMasking.labels, AutoMasking.textInputs],
  child: MyApp(),
); 
//OR 
Luciq.setAutoMaskScreenshotTypes([masking_types])
// To disable auto masking, // Empty list does not disable; you must pass [AutoMasking.none].
```

***

#### Manual (per-view) masking

For specific views, mark the view itself rather than relying on type-based rules. Marking a ViewGroup or Compose parent automatically masks every descendant. The flag works on any view reference — including views inflated at runtime from server JSON — with no compile-time annotation, manifest entry, or XML attribute required.

**Private-view behavior**

* **Black overlay** — the entire view area renders as a solid black rectangle.
* **Subtree masked** — all child views are masked as well.
* **Real-time** — masking applies to all screenshots captured during the session.

{% hint style="info" %}
**Precedence:** on every platform the private-view API takes precedence over auto masking. Wrapping/marking a view as private is the way to guarantee it is always masked.
{% endhint %}

**Android — classic views**

```
// Kotlin
Luciq.addPrivateViews(cardNumberView, balanceView)
// Later, if no longer sensitive:
Luciq.removePrivateViews(balanceView)
// Or clear everything you've marked:
Luciq.removeAllPrivateViews()
```

**Android — Jetpack Compose**

```
// Kotlin
Text(
    text = user.email,
    modifier = Modifier.luciqPrivate(isPrivate = true)
)
```

**iOS — SwiftUI & UIKit**

```
// Swift
view.Luciq_privateView = true
// SwiftUI
view.luciqPrivate()
// UIKit
view.ibgPrivate = true
```

**React Native**

```
// Mark a view by ref
Luciq.addPrivateView(this.textView);
// Remove private view
Luciq.removePrivateView(view1);
```

**Flutter**

```
// Wrap any widget
LuciqPrivateView(
  child: TextFormField(decoration: const InputDecoration(hintText: "Password")),
);
// For slivers inside a scrollable list
LuciqSliverPrivateView(
  child: SliverFillRemaining(child: Text("Masked sliver content")),
);
```

***

#### Masking and screen recording <a href="#id-2.4-masking-and-screen-recording" id="id-2.4-masking-and-screen-recording"></a>

Screen-recording behavior by platform

|                             | Screenshots (Repro Steps) | Screen recordings             |
| --------------------------- | ------------------------- | ----------------------------- |
| **Private views — iOS**     | Masked                    | Masked                        |
| **Private views — Android** | Masked                    | Not masked — use FLAG\_SECURE |
| **Auto type-based masking** | Masked                    | Not applied                   |

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.luciq.ai/product-guides-and-integrations/product-guides/luciq-pii-masking/screen-and-screenshot-masking.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
