feat(feedback): add runtime shake gesture toggle API#7737
feat(feedback): add runtime shake gesture toggle API#7737
Conversation
Add SentrySDK.feedback.enableShakeGesture() and disableShakeGesture() for dynamic control at runtime.
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Documentation 📚
Internal Changes 🔧Deps
Other
🤖 This preview updates automatically when you update the PR. |
|
Remove existing shake observer before adding in enableShakeGesture() to prevent duplicate notifications on repeated calls or when useShakeGesture was set at init. Add test-only cooldown reset to eliminate 1.1s sleep in re-enable test.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7737 +/- ##
=============================================
- Coverage 85.375% 85.047% -0.328%
=============================================
Files 487 487
Lines 28985 28999 +14
Branches 12551 12549 -2
=============================================
- Hits 24746 24663 -83
- Misses 4193 4288 +95
- Partials 46 48 +2
... and 15 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
|
@sentry review |
|
@cursor review |
|
Closing this as we decided not to proceed with exposing this API / cc @christophaigner |
📜 Description
Add
SentrySDK.feedback.enableShakeGesture()andSentrySDK.feedback.disableShakeGesture()for dynamic control of shake-to-report at runtime, similar to the React Native API.This allows users to enable/disable shake gesture on specific screens or app contexts without restarting the SDK.
💡 Motivation and Context
The existing
useShakeGestureconfig is set at SDK init time and can't be changed at runtime. Users need per-screen control (e.g., enable in settings, disable in checkout).Builds on #7579 which added the initial shake gesture detection.
💚 How did you test it?
make format,make analyze,make build-ios, all pass📝 Checklist
sendDefaultPIIis enabled.