Skip to content

Commit

Permalink
chore: Updated sample configure callback (#1341)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsandfoxes authored May 30, 2023
1 parent bf5e705 commit 0e2cef5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- Updated sample configure callback to use the new `BeforeSend`methods that allow the use of `Hints` ([#1341](https://github.com/getsentry/sentry-unity/pull/1341))

### Dependencies

- Bump Cocoa SDK from v8.7.2 to v8.7.3 ([#1342](https://github.com/getsentry/sentry-unity/pull/1342))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Sentry.Unity;

[CreateAssetMenu(fileName = "Assets/Resources/Sentry/BuildTimeConfiguration.asset", menuName = "Sentry/BuildTimeConfiguration", order = 999)]
public class BuildTimeConfiguration : Sentry.Unity.SentryBuildTimeOptionsConfiguration
public class BuildTimeConfiguration : SentryBuildTimeOptionsConfiguration
{
/// Called during app build. Changes made here will affect build-time processing, symbol upload, etc.
/// Additionally, because iOS, macOS and Android native error handling is configured at build time,
Expand Down
7 changes: 4 additions & 3 deletions samples/unity-of-bugs/Assets/Scripts/RuntimeConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using Sentry;
using UnityEngine;
using Sentry.Unity;
using UnityEngine.SceneManagement;

[CreateAssetMenu(fileName = "Assets/Resources/Sentry/RuntimeConfiguration.asset", menuName = "Sentry/RuntimeConfiguration", order = 999)]
public class RuntimeConfiguration : Sentry.Unity.SentryRuntimeOptionsConfiguration
public class RuntimeConfiguration : SentryRuntimeOptionsConfiguration
{
/// Called at the player startup by SentryInitialization.
/// You can alter configuration for the C# error handling and also
Expand All @@ -25,7 +26,7 @@ public override void Configure(SentryUnityOptions options)
}

// BeforeSend is only relevant at runtime. It wouldn't hurt to be set at build time, just wouldn't do anything.
options.BeforeSend = sentryEvent =>
options.SetBeforeSend((sentryEvent, _) =>
{
if (sentryEvent.Tags.ContainsKey("SomeTag"))
{
Expand All @@ -34,7 +35,7 @@ public override void Configure(SentryUnityOptions options)
}
return sentryEvent;
};
});

Debug.Log(nameof(RuntimeConfiguration) + "::Configure() finished");
}
Expand Down

0 comments on commit 0e2cef5

Please sign in to comment.