Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixes

- `CaptureFeedback` now returns a `SentryId` and exposes a `CaptureFeedbackResult` out parameter to indicate whether feedback was captured successfully ([#2589](https://github.com/getsentry/sentry-unity/pull/2579))
- The SDK now also uses `.sentry-native` as a subdirectory for native support on desktop platforms. It now also falls back to `Application.persistentDataPath` instead of the current working directory. Note: `crashedLastRun` may report `false` for the first time after upgrading. ([#2547](https://github.com/getsentry/sentry-unity/pull/2547))
- The currently experimental Metrics are now opt-in by default ([#2546](https://github.com/getsentry/sentry-unity/pull/2546))
- When targeting Android, the SDK now syncs `AppStartTime` and `AppBuildType` to the native layer ([#2557](https://github.com/getsentry/sentry-unity/pull/2557))
Expand Down
22 changes: 19 additions & 3 deletions src/Sentry.Unity/SentrySdk.Dotnet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,21 +315,37 @@ public static SentryId CaptureMessage(string message, Action<Scope> configureSco
/// Captures feedback from the user.
/// </summary>
[DebuggerStepThrough]
public static void CaptureFeedback(SentryFeedback feedback, Action<Scope> configureScope, SentryHint? hint = null)
public static SentryId CaptureFeedback(SentryFeedback feedback, Action<Scope> configureScope, SentryHint? hint = null)
=> Sentry.SentrySdk.CaptureFeedback(feedback, configureScope, hint);

/// <summary>
/// Captures feedback from the user.
/// </summary>
[DebuggerStepThrough]
public static void CaptureFeedback(SentryFeedback feedback, Scope? scope = null, SentryHint? hint = null)
public static SentryId CaptureFeedback(SentryFeedback feedback, out CaptureFeedbackResult result,
Action<Scope> configureScope, SentryHint? hint = null)
=> Sentry.SentrySdk.CaptureFeedback(feedback, out result, configureScope, hint);

/// <summary>
/// Captures feedback from the user.
/// </summary>
[DebuggerStepThrough]
public static SentryId CaptureFeedback(SentryFeedback feedback, Scope? scope = null, SentryHint? hint = null)
=> Sentry.SentrySdk.CaptureFeedback(feedback, scope, hint);

/// <summary>
/// Captures feedback from the user.
/// </summary>
[DebuggerStepThrough]
public static void CaptureFeedback(string message, string? contactEmail = null, string? name = null,
public static SentryId CaptureFeedback(SentryFeedback feedback, out CaptureFeedbackResult result,
Scope? scope = null, SentryHint? hint = null)
=> Sentry.SentrySdk.CaptureFeedback(feedback, out result, scope, hint);

/// <summary>
/// Captures feedback from the user.
/// </summary>
[DebuggerStepThrough]
public static SentryId CaptureFeedback(string message, string? contactEmail = null, string? name = null,
string? replayId = null, string? url = null, SentryId? associatedEventId = null, Scope? scope = null,
SentryHint? hint = null)
=> Sentry.SentrySdk.CaptureFeedback(new SentryFeedback(message, contactEmail, name, replayId, url, associatedEventId),
Expand Down
4 changes: 2 additions & 2 deletions src/Sentry.Unity/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ public static CrashedLastRun GetLastRunState()
/// <summary>
/// Captures a User Feedback
/// </summary>
public static void CaptureFeedback(string message, string? email, string? name, bool addScreenshot) =>
UnitySdk?.CaptureFeedback(message, email, name, addScreenshot);
public static SentryId CaptureFeedback(string message, string? email, string? name, bool addScreenshot) =>
UnitySdk?.CaptureFeedback(message, email, name, addScreenshot) ?? SentryId.Empty;
}
6 changes: 3 additions & 3 deletions src/Sentry.Unity/SentryUnitySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ public SentrySdk.CrashedLastRun CrashedLastRun()
: SentrySdk.CrashedLastRun.DidNotCrash;
}

public void CaptureFeedback(string message, string? email, string? name, bool addScreenshot)
public SentryId CaptureFeedback(string message, string? email, string? name, bool addScreenshot)
{
if (string.IsNullOrWhiteSpace(message))
{
_options.LogError("To submit a feedback, you must provide a message.");
return;
return SentryId.Empty;
}

SentryHint? hint = null;
Expand Down Expand Up @@ -150,7 +150,7 @@ public void CaptureFeedback(string message, string? email, string? name, bool ad
}
}

Sentry.SentrySdk.CurrentHub.CaptureFeedback(message, email, name, hint: hint);
return Sentry.SentrySdk.CurrentHub.CaptureFeedback(message, email, name, hint: hint);
}

internal static void SetUpWindowsPlayerCaching(SentryUnitySdk unitySdk, SentryUnityOptions options)
Expand Down
4 changes: 2 additions & 2 deletions test/Sentry.Unity.Tests/Stubs/TestHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SentryId CaptureFeedback(SentryFeedback feedback, out CaptureFeedbackResu
throw new NotImplementedException();
}

public void CaptureFeedback(SentryFeedback feedback, Scope? scope = null, SentryHint? hint = null)
public SentryId CaptureFeedback(SentryFeedback feedback, Scope? scope = null, SentryHint? hint = null)
{
throw new NotImplementedException();
}
Expand Down Expand Up @@ -202,7 +202,7 @@ public SentryId CaptureFeedback(SentryFeedback feedback, out CaptureFeedbackResu
throw new NotImplementedException();
}

public void CaptureFeedback(SentryFeedback feedback, Action<Scope> configureScope, SentryHint? hint = null)
public SentryId CaptureFeedback(SentryFeedback feedback, Action<Scope> configureScope, SentryHint? hint = null)
{
throw new NotImplementedException();
}
Expand Down
Loading