Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add samples for SetBeforeSend
  • Loading branch information
aritchie committed Mar 4, 2025
commit 2983af01a671a5c01ada944bdc933e9b186c403e
4 changes: 4 additions & 0 deletions samples/Sentry.Samples.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ protected override void OnCreate(Bundle? savedInstanceState)

options.SetBeforeSend(evt =>
{
if (evt.Exception?.Message.Contains("Something you don't care about?") ?? false)
{
return null; // return null to filter out event
}
return evt;
});
});
Expand Down
9 changes: 9 additions & 0 deletions samples/Sentry.Samples.Ios/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary l
options.Native.EnableAppHangTracking = true;

options.CacheDirectoryPath = Path.GetTempPath();

options.SetBeforeSend(evt =>
{
if (evt.Exception?.Message.Contains("Something you don't care about?") ?? false)
{
return null; // return null to filter out event
}
return evt;
});
});

// create a new window instance based on the screen size
Expand Down