From 7cf6a7e03bc836b29e2d0fad7a87c0756f6296f4 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 17 Jun 2022 07:24:12 -0700 Subject: [PATCH] [Crashlytics] Move the crash handler initializer Move the initializer to a function that will be called earlier in the startup stage. Mainly to catch crashes in the playlist importer for legacy playlist formats. Signed-off-by: Christopher Snowhill --- Application/AppController.m | 5 +++++ Application/MediaKeysApplication.m | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Application/AppController.m b/Application/AppController.m index 8c0a2f747..3362b5ae2 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -29,6 +29,8 @@ #import +@import Firebase; + void *kAppControllerContext = &kAppControllerContext; @implementation AppController { @@ -141,6 +143,9 @@ void *kAppControllerContext = &kAppControllerContext; } - (void)awakeFromNib { + [[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions": @(YES) }]; + [FIRApp configure]; + #ifdef DEBUG // Prevent updates automatically in debug builds [updater setAutomaticallyChecksForUpdates:NO]; diff --git a/Application/MediaKeysApplication.m b/Application/MediaKeysApplication.m index 569b1f4e1..ab0befa25 100644 --- a/Application/MediaKeysApplication.m +++ b/Application/MediaKeysApplication.m @@ -16,8 +16,6 @@ #import #import -@import Firebase; - @implementation MediaKeysApplication { AppController *_appController; } @@ -26,9 +24,6 @@ [super finishLaunching]; _appController = (AppController *)[self delegate]; - [[NSUserDefaults standardUserDefaults] registerDefaults:@{@"NSApplicationCrashOnExceptions" : @(YES)}]; - [FIRApp configure]; - MPRemoteCommandCenter *remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter]; [remoteCommandCenter.playCommand setEnabled:YES];