Repository navigation
feat(replay): Add touch tracking pause API - #4166
Merged
Merged
Conversation
Bridge the native touch tracking pause to SentryFlutter.replay, so apps can stop recording touch positions on sensitive screens, such as a custom PIN pad, while the masked screen recording continues. The JNI bindings for ReplayIntegration.pauseTouchTracking() and resumeTouchTracking() are added by hand in jnigen's output shape, because sentry-android 8.65.0 is not released yet. Fixes DART-444 Fixes #3903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Features
Fixes
DependenciesDeps
Internal Changes
🤖 This preview updates automatically when you update the PR. |
Contributor
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
This was referenced Nov 13, 2026
Contributor
|
Sentry Android 8.65.0 and Sentry Cocoa 9.36.0 is now on main |
buenaflor
approved these changes
Nov 26, 2026
This was referenced Nov 26, 2026
romtsn
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Nov 27, 2026
## DESCRIBE YOUR PR Documents the new `pauseTouchTracking()` and `resumeTouchTracking()` Session Replay APIs for Android, Apple, React Native and Flutter, in a new "Pause Touch Tracking" section under "Manual Control" on each Session Replay page. The APIs stop recording touches on sensitive screens, such as a custom PIN pad, while the masked screen recording continues. SDK PRs: - Android: getsentry/sentry-java#6546 (merged) - Apple: getsentry/sentry-cocoa#9587 - React Native: getsentry/sentry-react-native#7030 - Flutter: getsentry/sentry-dart#4166 The version numbers in the text are the expected next releases: Android 8.65.0, Apple 9.35.0, React Native 8.36.0, Flutter 10.5.0. The hybrid SDKs can only ship after the native releases, so their numbers are the least certain. Please do not merge before all SDK PRs are released, and update the numbers if the release versions differ. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. Thanks in advance for your help! ## PRE-MERGE CHECKLIST _Make sure you've checked the following before merging your changes:_ - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Antonis Lilis <antonis.lilis@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Adds
SentryFlutter.replay.pauseTouchTracking()andresumeTouchTracking(). While touch tracking is paused, the native SDKs record no touch positions, but the masked screen recording continues. Breadcrumbs are not affected.This is a bridge only; the behavior lives in the native SDKs, which record touches on Flutter too:
pause()/resume().resume()does not resume touch tracking.resumeTouchTracking()clears it, also across new replays andstop()/start(). It can be called before a replay starts.The calls are wired exactly like
pause/resume:SentryReplay→SentryNativeBinding.pauseReplayTouchTracking()/resumeReplayTouchTracking()→ JNIReplayIntegration.pauseTouchTracking()on Android and thecontrolReplaymethod channel →SentrySDK.internal.replay.pauseTouchTracking()on iOS. On Web, desktop and the C SDK they are no-ops, likepause().The native APIs come from getsentry/sentry-java#6546 (sentry-android 8.65.0) and getsentry/sentry-cocoa#9587 (sentry-cocoa 9.36.0), both already on
main. TheReplayIntegrationJNI bindings were regenerated with the sentry-android bump.SentryReplayis anabstract interface class, so code outside the SDK that implements it must add the two methods.SentryFlutter.replaycan't be replaced, so this only affects hand-written test doubles or wrappers.💡 Motivation and Context
Masking hides sensitive content such as a custom PIN pad or a masked
WebView, but the recorded touch positions can still reveal the input.pause()already stops touches, but it also stops the screen recording, which some apps want to keep.Fixes #3903
Fixes DART-444
Docs: getsentry/sentry-docs#20711
💚 How did you test it?
Unit tests in
replay_api_test.dart(forwarding, and no call when the platform has no replay) andsentry_native_channel_test.dart(method channel names). Thereplay_test.dartintegration test calls both methods on mobile.📝 Checklist
sendDefaultPiiis enabledChangelog Entry
SentryFlutter.replay.pauseTouchTracking()andresumeTouchTracking()to stop recording touch positions on sensitive screens, such as a custom PIN pad, while the masked screen recording continues. Touch tracking stays paused across new replays and afterresume()untilresumeTouchTracking()is called. Code that implementsSentryReplaymust add the two methods