diff --git a/docs/platforms/apple/common/user-feedback/configuration/index.mdx b/docs/platforms/apple/common/user-feedback/configuration/index.mdx index 29a903eb333bdc..9f1ace79998a25 100644 --- a/docs/platforms/apple/common/user-feedback/configuration/index.mdx +++ b/docs/platforms/apple/common/user-feedback/configuration/index.mdx @@ -48,7 +48,7 @@ The following options can be configured in `SentryUserFeedbackConfiguration`: | Option | Type | Default | Description | | ------------------------ | --------------- | ------- | ----------------------------------------------------------------------------------------------- | | `animations` | `Bool` | `true` | Shows animations when presenting and dismissing the form. | -| `useShakeGesture` | `Bool` | `false` | Opens the form when the user shakes the device. | +| `useShakeGesture` | `Bool` | `false` | Opens the form when the user shakes the device. Toggle it at runtime with `SentrySDK.feedback.enableOnShake()` / `disableOnShake()`. | | `showFormForScreenshots` | `Bool` | `false` | Opens the form when the user takes a screenshot and attaches that screenshot. | | `configureForm` | Callback | `nil` | Configures the managed form fields and labels. | | `configureTheme` | Callback | `nil` | Configures colors, fonts, and form element outlines. | diff --git a/docs/platforms/apple/common/user-feedback/index.mdx b/docs/platforms/apple/common/user-feedback/index.mdx index e5a2db64ab65e4..32715327c07ca0 100644 --- a/docs/platforms/apple/common/user-feedback/index.mdx +++ b/docs/platforms/apple/common/user-feedback/index.mdx @@ -225,6 +225,24 @@ SentrySDK.start { options in }]; ``` +In version [9.25.0](https://github.com/getsentry/sentry-cocoa/releases/tag/9.25.0) or later, you can also enable or disable the shake gesture at runtime, for example once an asynchronously resolved feature flag or user role decides whether to offer feedback. This requires the User Feedback integration to be configured via `configureUserFeedback`; otherwise the calls are a no-op. Call these methods from the main thread. + +```swift {tabTitle:Swift} {mdExpandTabs} +// Start detecting shake gestures to open the feedback form +SentrySDK.feedback.enableOnShake() + +// Stop detecting shake gestures +SentrySDK.feedback.disableOnShake() +``` + +```objc {tabTitle:Objective-C} +// Start detecting shake gestures to open the feedback form +[[SentryObjCSDK feedback] enableOnShake]; + +// Stop detecting shake gestures +[[SentryObjCSDK feedback] disableOnShake]; +``` + ### Session Replay The managed feedback form works with Session Replay. When the form opens, the Replay SDK buffers up to 30 seconds of the user's session. If the user submits feedback, the replay is sent with the feedback so you can see what led up to it.