From acc6b51e506bc66399d462440ac5ee0cea0734be Mon Sep 17 00:00:00 2001 From: Anna Garcia Date: Thu, 2 Jul 2026 15:12:30 -0400 Subject: [PATCH 1/3] docs: document platform view masking for Flutter session replay --- .../_snippets/flutter-privacy.mdx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/contents/docs/session-replay/_snippets/flutter-privacy.mdx b/contents/docs/session-replay/_snippets/flutter-privacy.mdx index e809424e8efb..85431cf4e6ea 100644 --- a/contents/docs/session-replay/_snippets/flutter-privacy.mdx +++ b/contents/docs/session-replay/_snippets/flutter-privacy.mdx @@ -23,4 +23,36 @@ config.sessionReplayConfig.maskAllImages = false; ... ``` +### Masking platform views + +Platform views (such as `WebView`, Google Maps, or other natively-rendered widgets) are composited outside the Flutter layer tree. To avoid accidentally recording sensitive content, PostHog **masks every platform view with a black box by default**. + +To reveal all platform views globally, set `maskAllPlatformViews` to `false`: + +```dart +final config = PostHogConfig(''); +config.sessionReplay = true; +/// Mask all platform views (WebView, Maps, etc.) in session replay. +/// Default: true. +config.sessionReplayConfig.maskAllPlatformViews = false; +``` + +For per-view control, wrap an individual platform view with the `PostHogPlatformView` widget. This overrides the global `maskAllPlatformViews` setting for that view (and every platform view in its subtree): + +```dart +// Reveal this view even when maskAllPlatformViews is true +PostHogPlatformView( + privacy: PostHogPlatformViewPrivacy.capture, + child: WebViewWidget(controller: _controller), +) + +// Mask this view even when maskAllPlatformViews is false +PostHogPlatformView( + privacy: PostHogPlatformViewPrivacy.mask, + child: WebViewWidget(controller: _controller), +) +``` + +> **Platform support:** On iOS, only `WKWebView`-backed platform views (for example `webview_flutter` in its default mode) are captured. Other platform view types — Google Maps, ARKit, camera previews, and so on — are always masked, because the iOS compositor cannot safely snapshot arbitrary native views without risking leaking unmasked content. Capture is not supported on macOS, where all platform views are always masked. + \ No newline at end of file From f2377ea204259e9849900139e41cb1106dd59f43 Mon Sep 17 00:00:00 2001 From: Anna Garcia Date: Thu, 2 Jul 2026 15:15:03 -0400 Subject: [PATCH 2/3] docs: fix Vale prose lint (en dash, spelling) --- contents/docs/session-replay/_snippets/flutter-privacy.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contents/docs/session-replay/_snippets/flutter-privacy.mdx b/contents/docs/session-replay/_snippets/flutter-privacy.mdx index 85431cf4e6ea..c73aaf7c78d7 100644 --- a/contents/docs/session-replay/_snippets/flutter-privacy.mdx +++ b/contents/docs/session-replay/_snippets/flutter-privacy.mdx @@ -37,7 +37,7 @@ config.sessionReplay = true; config.sessionReplayConfig.maskAllPlatformViews = false; ``` -For per-view control, wrap an individual platform view with the `PostHogPlatformView` widget. This overrides the global `maskAllPlatformViews` setting for that view (and every platform view in its subtree): +For per-view control, wrap an individual platform view with the `PostHogPlatformView` widget. This overrides the global `maskAllPlatformViews` setting for that view (and every platform view nested inside it): ```dart // Reveal this view even when maskAllPlatformViews is true @@ -53,6 +53,6 @@ PostHogPlatformView( ) ``` -> **Platform support:** On iOS, only `WKWebView`-backed platform views (for example `webview_flutter` in its default mode) are captured. Other platform view types — Google Maps, ARKit, camera previews, and so on — are always masked, because the iOS compositor cannot safely snapshot arbitrary native views without risking leaking unmasked content. Capture is not supported on macOS, where all platform views are always masked. +> **Platform support:** On iOS, only `WKWebView`-backed platform views (for example `webview_flutter` in its default mode) are captured. Other platform view types (Google Maps, camera previews, and so on) are always masked, because the iOS compositor cannot safely snapshot arbitrary native views without risking leaking unmasked content. Capture is not supported on macOS, where all platform views are always masked. \ No newline at end of file From 5949413b86701498928c20e167d7ced58469e90e Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Date: Fri, 3 Jul 2026 10:59:05 +0200 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> --- contents/docs/session-replay/_snippets/flutter-privacy.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/docs/session-replay/_snippets/flutter-privacy.mdx b/contents/docs/session-replay/_snippets/flutter-privacy.mdx index c73aaf7c78d7..7f8b8727ee1e 100644 --- a/contents/docs/session-replay/_snippets/flutter-privacy.mdx +++ b/contents/docs/session-replay/_snippets/flutter-privacy.mdx @@ -53,6 +53,6 @@ PostHogPlatformView( ) ``` -> **Platform support:** On iOS, only `WKWebView`-backed platform views (for example `webview_flutter` in its default mode) are captured. Other platform view types (Google Maps, camera previews, and so on) are always masked, because the iOS compositor cannot safely snapshot arbitrary native views without risking leaking unmasked content. Capture is not supported on macOS, where all platform views are always masked. +> **Platform support:** On iOS, only `WKWebView`-backed platform views (for example `webview_flutter` in its default mode) are captured. Other platform view types (Google Maps, camera previews, and so on) are always masked, because the iOS compositor cannot safely snapshot arbitrary native views without risking leaking unmasked content. \ No newline at end of file