-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Added Unity UserFeedback
Prefab
#14667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,21 +5,56 @@ description: "Learn more about collecting user feedback when an event occurs. Se | |
sidebar_order: 6000 | ||
--- | ||
|
||
When a user experiences an error, Sentry provides the ability to collect additional feedback. You can collect feedback according to the method supported by the SDK. | ||
<Alert level="info"> | ||
|
||
## Use the .NET SDK | ||
The User Feedback Prefab is available in version `4.0.0` of the Sentry SDK for Unity, which is currently in beta. | ||
|
||
<Alert> | ||
</Alert> | ||
|
||
User Feedback for **[ASP.NET](/platforms/dotnet/guides/aspnet/user-feedback/#integration)** or **[ASP.NET Core](/platforms/dotnet/guides/aspnetcore/user-feedback/#integration)** supply integrations specific to supporting those SDKs. | ||
When a user experiences an error, Sentry provides the ability to collect additional feedback. The Unity SDK provides both a simple prefab-based solution and a programmatic API for collecting user feedback. | ||
|
||
</Alert> | ||
## Use the User Feedback Prefab | ||
|
||
The Unity SDK includes a ready-to-use prefab that provides a complete user feedback solution. This prefab contains: | ||
|
||
- A feedback button (megaphone icon) that opens the feedback form | ||
- A feedback form with fields for: | ||
- Name (optional) | ||
- Email (optional) | ||
- Message/feedback (required) | ||
- Screenshot (optional, taken automatically) | ||
|
||
### Adding the Prefab to Your Scene | ||
|
||
To add the prefab, drag and drop the User Feedback prefab from the Unity SDK package into any scene. The prefab is ready to use immediately without any additional configuration, and includes a scaling canvas that works across different screen sizes and resolutions. | ||
|
||
### Default Appearance | ||
|
||
The User Feedback prefab includes a megaphone button that triggers the feedback form: | ||
|
||
You can create a form to collect the user input in your preferred framework, and use the SDK's API to send the information to Sentry. You can also use the widget, as described below. If you'd prefer an alternative to the widget or do not have a web frontend, you can use this API: | ||
 | ||
|
||
When clicked, the feedback form appears with fields for user input: | ||
|
||
 | ||
|
||
### Customization | ||
|
||
You can customize the feedback form by: | ||
|
||
- Creating a prefab variant to inherit from the original while allowing updates | ||
- Removing optional fields (name, email) by deleting them from the VerticalLayoutGroup | ||
- Modifying the appearance and styling of the form elements | ||
- The prefab comes with a custom inspector that highlights missing or broken references: | ||
- Missing optional fields are highlighted in yellow | ||
- Missing required fields are highlighted in red | ||
|
||
## Use the .NET SDK API | ||
|
||
If you prefer to create your own feedback form or need programmatic control, you can use the SDK's API to send feedback to Sentry: | ||
|
||
```csharp {tabTitle:C#} | ||
var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback."); | ||
|
||
SentrySdk.CaptureFeedback("It broke.", "[email protected]", "The User", associatedEventId: eventId); | ||
``` | ||
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.