-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(.NET): Screenshots for MAUI (#9120)
- Loading branch information
1 parent
4a60351
commit fd4673d
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
28 changes: 28 additions & 0 deletions
28
docs/platforms/dotnet/guides/maui/enriching-events/screenshots/index.mdx
This file contains 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: "Screenshots" | ||
description: "Learn more about taking screenshots when an error occurs. Sentry pairs the screenshot with the original event, giving you additional insight into issues." | ||
--- | ||
|
||
If a user experiences an error, an exception or a crash, Sentry gives you the option to capture a screenshot and include it as an <PlatformLink to="/enriching-events/attachments/">attachment</PlatformLink>. | ||
|
||
This feature is only available for SDKs with a user interface, such as the ones for mobile and desktop applications. In some environments like native iOS, taking a screenshot requires the UI thread and in the event of a crash, that might not be available. Another example where a screenshot might not be available is when the event happens before the screen starts to load. So inherently, this feature is a best effort solution. | ||
|
||
## Enabling Screenshots | ||
|
||
Because screenshots may contain <PlatformLink to="/data-management/sensitive-data/">PII</PlatformLink>, they are an opt-in feature. You can enable screenshots as shown below: | ||
|
||
<PlatformContent includePath="enriching-events/attach-screenshots" /> | ||
|
||
Capturing a screenshot is a synchronous operation supported on both iOS and Android. For iOS, a UI thread is required. | ||
|
||
## Viewing Screenshots | ||
|
||
If one is available, you'll see a thumbnail of the screenshot if you click on a specific issue from the [**Issues**](https://demo.sentry.io/issues/) page: | ||
|
||
![Screenshot Thumbnail](/platforms/dotnet/guides/xamarin/enriching-events/screenshots/screenshot-thumbnail.png) | ||
|
||
Once you've clicked on the event ID of specific issue, you'll also be able to view screenshots from the "Attachments" tab where you'll be able to see attachments, as well as associated events. | ||
|
||
![Screenshots List Example](/platforms/dotnet/guides/xamarin/enriching-events/screenshots/screenshot-list-example.png) | ||
|
||
|
11 changes: 11 additions & 0 deletions
11
platform-includes/enriching-events/attach-screenshots/dotnet.maui.mdx
This file contains 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<SignInNote /> | ||
|
||
```csharp | ||
var builder = MauiApp.CreateBuilder() | ||
.UseMauiApp<App>() | ||
.UseSentry(options => | ||
{ | ||
options.Dsn = "___PUBLIC_DSN___"; | ||
options.AttachScreenshot = true; | ||
}) | ||
``` |