Skip to content

Commit 52c469b

Browse files
antonisclauderomtsn
authored
docs(android): Add shake-to-report feedback documentation (#16792)
## DESCRIBE YOUR PR Document the new shake-to-report feature for Android user feedback, based on [sentry-java#5150](getsentry/sentry-java#5150). - Add "Shake to Report" section to the user feedback setup page with Java/Kotlin examples - Add `useShakeGesture` option to the Form Configuration table ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [x] None: Not urgent, can wait up to 1 week+ ⚠️ Should be merged after getsentry/sentry-java#5150 is released ## 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 added an urgent due date to it. 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) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
1 parent 849238c commit 52c469b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/platforms/android/user-feedback/configuration/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ You can customize which form elements are shown, whether they are required, and
9999
| `showName` | `Bool` | `true` | Displays the name field on the feedback form. Ignored if `isNameRequired` is `true`. |
100100
| `isEmailRequired` | `Bool` | `false` | Requires the email field on the feedback form to be filled in. |
101101
| `showEmail` | `Bool` | `true` | Displays the email field on the feedback form. Ignored if `isEmailRequired` is `true`. |
102+
| `useShakeGesture` | `Bool` | `false` | Opens the feedback form when the user shakes the device. Uses the accelerometer and requires no additional permissions. |
102103
| `useSentryUser` | `Bool` | `true` | Sets the `email` and `name` fields to the corresponding Sentry SDK user fields that were called with `SentrySDK.setUser`. |
103104

104105
Example:
@@ -111,6 +112,7 @@ Example:
111112
<meta-data android:name="io.sentry.feedback.show-email" android:value="false" />
112113
<meta-data android:name="io.sentry.feedback.use-sentry-user" android:value="false" />
113114
<meta-data android:name="io.sentry.feedback.show-branding" android:value="false" />
115+
<meta-data android:name="io.sentry.feedback.use-shake-gesture" android:value="true" />
114116
</application>
115117
```
116118
```java
@@ -121,6 +123,7 @@ SentryAndroid.init(context, options -> {
121123
options.getFeedbackOptions().setShowEmail(false);
122124
options.getFeedbackOptions().setUseSentryUser(false);
123125
options.getFeedbackOptions().setShowBranding(false);
126+
options.getFeedbackOptions().setUseShakeGesture(true);
124127
});
125128
```
126129
```kotlin
@@ -131,6 +134,7 @@ SentryAndroid.init(this) { options ->
131134
options.feedbackOptions.isShowEmail = false
132135
options.feedbackOptions.isUseSentryUser = false
133136
options.feedbackOptions.isShowBranding = false
137+
options.feedbackOptions.isUseShakeGesture = true
134138
}
135139
```
136140

docs/platforms/android/user-feedback/index.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,26 @@ val widget = SentryUserFeedbackButton(context)
4444
```
4545

4646

47+
## Shake to Report
48+
49+
You can enable shake-to-report so that shaking the device opens the User Feedback form. This uses the device's accelerometer and does not require any additional permissions.
50+
51+
```java
52+
SentryAndroid.init(context, options -> {
53+
options.getFeedbackOptions().setUseShakeGesture(true);
54+
});
55+
```
56+
```kotlin
57+
SentryAndroid.init(this) { options ->
58+
options.feedbackOptions.isUseShakeGesture = true
59+
}
60+
```
61+
```xml {filename:AndroidManifest.xml}
62+
<application>
63+
<meta-data android:name="io.sentry.feedback.use-shake-gesture" android:value="true" />
64+
</application>
65+
```
66+
4767
## User Feedback Form
4868

4969
The User Feedback form allows users to submit feedback from anywhere inside your application.

0 commit comments

Comments
 (0)