@@ -25,11 +25,11 @@ Sentry supports [.NET for Android](https://learn.microsoft.com/dotnet/android/ge
2525Add the Sentry dependency to your .NET for Android application:
2626
2727``` shell {tabTitle:.NET Core CLI}
28- dotnet add package Sentry.Maui -v {{@inject packages.version(' sentry.dotnet' ) }}
28+ dotnet add package Sentry -v {{@inject packages.version(' sentry.dotnet' ) }}
2929```
3030
3131``` powershell {tabTitle:Package Manager}
32- Install-Package Sentry.Maui -Version {{@inject packages.version('sentry.dotnet') }}
32+ Install-Package Sentry -Version {{@inject packages.version('sentry.dotnet') }}
3333```
3434
3535## Configure
@@ -47,6 +47,10 @@ public class MainActivity : Activity
4747 {
4848 options .Dsn = " ___PUBLIC_DSN___" ;
4949 options .SendDefaultPii = true ; // adds the user's IP address automatically
50+ #if DEBUG
51+ // Log debug information about the Sentry SDK
52+ options .Debug = true ;
53+ #endif
5054
5155 // Android specific .NET features are under the Android properties:
5256 options .Android .LogCatIntegration = LogCatIntegrationType .Errors ; // Get logcat logs for both handled and unhandled errors; default is unhandled only
@@ -67,32 +71,14 @@ public class MainActivity : Activity
6771 {
6872 if (evt .Exception ? .Message .Contains (" Something you don't care want logged?" ) ?? false )
6973 {
70- // return null to filter out an event
71- return null ;
74+ return null ; // return null to filter out event
7275 }
7376 // or add additional data
7477 evt .SetTag (" dotnet-Android-Native-Before" , " Hello World" );
7578 return evt ;
7679 });
7780 });
7881
79- // Here's an example of adding custom scope information.
80- // This can be done at any time, and will be passed through to the Native Android SDK as well.
81- SentrySdk .ConfigureScope (scope =>
82- {
83- scope .AddBreadcrumb (" Custom Breadcrumb" );
84- scope .SetExtra (" Test" , " Custom Extra Data" );
85- scope .User = new SentryUser
86- {
87- Username = " SomeUser" ,
88- 89- Other =
90- {
91- [" CustomInfo" ] = " Custom User Info"
92- }
93- };
94- });
95-
9682 base .OnCreate (savedInstanceState );
9783 }
9884}
0 commit comments