Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed SentrySdk.Init overloads accepting AndroidContext context #3562

Merged
merged 2 commits into from
Aug 26, 2024
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### API Changes
- You should no longer pass `AndroidContext` as an argument to `SentrySdk.Init` ([#3562](https://github.com/getsentry/sentry-dotnet/pull/3562))

## 4.10.2

### Various fixes & improvements
Expand Down
28 changes: 0 additions & 28 deletions src/Sentry/Platforms/Android/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,6 @@ public static partial class SentrySdk
{
private static AndroidContext AppContext { get; set; } = Application.Context;

/// <summary>
/// Initializes the SDK for Android, with an optional configuration options callback.
/// </summary>
/// <param name="context">The Android application context.</param>
/// <param name="configureOptions">The configuration options callback.</param>
/// <returns>An object that should be disposed when the application terminates.</returns>
[Obsolete("It is no longer required to provide the application context when calling Init. " +
"This method may be removed in a future major release.")]
public static IDisposable Init(AndroidContext context, Action<SentryOptions>? configureOptions)
{
AppContext = context;
return Init(configureOptions);
}

/// <summary>
/// Initializes the SDK for Android, using a configuration options instance.
/// </summary>
/// <param name="context">The Android application context.</param>
/// <param name="options">The configuration options instance.</param>
/// <returns>An object that should be disposed when the application terminates.</returns>
[Obsolete("It is no longer required to provide the application context when calling Init. " +
"This method may be removed in a future major release.")]
public static IDisposable Init(AndroidContext context, SentryOptions options)
{
AppContext = context;
return Init(options);
}

private static void InitSentryAndroidSdk(SentryOptions options)
{
// Set default release and distribution
Expand Down
Loading