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

fix: MAUI eventbinding moved to FinishedLaunching #3057

Merged
merged 4 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ If you have conflicts, you can opt-out by adding the following to your `csproj`:
</PropertyGroup>
```

### Fixes

- Moved the binding to MAUI events for breadcrumb creation from `WillFinishLaunching` to `FinishedLaunching`. This delays the initial instantiation of `app`. ([#3057](https://github.com/getsentry/sentry-dotnet/pull/3057))

### Dependencies

- Bump Java SDK from v7.1.0 to v7.2.0 ([#3049](https://github.com/getsentry/sentry-dotnet/pull/3049))
Expand Down
4 changes: 2 additions & 2 deletions src/Sentry.Maui/SentryMauiAppBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static void RegisterMauiEventsBinder(this MauiAppBuilder builder)
#if __IOS__
events.AddiOS(lifecycle =>
{
lifecycle.WillFinishLaunching((application, launchOptions) =>
lifecycle.FinishedLaunching((application, launchOptions) =>
{
// A bit of hackery here, because we can't mock UIKit.UIApplication in tests.
var platformApplication = application != null!
Expand All @@ -100,7 +100,7 @@ private static void RegisterMauiEventsBinder(this MauiAppBuilder builder)
platformApplication?.HandleMauiEvents(bind: false);
//According to https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623111-applicationwillterminate#discussion
//WillTerminate is called: in situations where the app is running in the background (not suspended) and the system needs to terminate it for some reason.
//WillTerminate is called: in situations where the app is running in the background (not suspended) and the system needs to terminate it for some reason.
SentryMauiEventProcessor.InForeground = false;
});
Expand Down
Loading