From ea1420356d322b6d3cc8e5a31b38adfa4cfb98f4 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 26 Feb 2024 18:05:19 +0100 Subject: [PATCH] Move firebase initialisation from appdelegate didFinishLaunchingWithOptionsto Corecontext init, which is called earlier --- Linphone/Core/CoreContext.swift | 7 +++++++ Linphone/LinphoneApp.swift | 8 ++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Linphone/Core/CoreContext.swift b/Linphone/Core/CoreContext.swift index 173e36237..1cadfdcbd 100644 --- a/Linphone/Core/CoreContext.swift +++ b/Linphone/Core/CoreContext.swift @@ -26,6 +26,10 @@ import Combine import UniformTypeIdentifiers import Network +#if USE_CRASHLYTICS +import Firebase +#endif + final class CoreContext: ObservableObject { static let shared = CoreContext() @@ -67,6 +71,9 @@ final class CoreContext: ObservableObject { func initialiseCore() throws { +#if USE_CRASHLYTICS + FirebaseApp.configure() +#endif coreQueue.async { LoggingService.Instance.logLevel = LogLevel.Debug diff --git a/Linphone/LinphoneApp.swift b/Linphone/LinphoneApp.swift index a9468c755..dd68f6b7b 100644 --- a/Linphone/LinphoneApp.swift +++ b/Linphone/LinphoneApp.swift @@ -18,18 +18,14 @@ */ import SwiftUI -#if USE_CRASHLYTICS -import Firebase -#endif +import linphonesw let accountTokenNotification = Notification.Name("AccountCreationTokenReceived") class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { -#if USE_CRASHLYTICS - FirebaseApp.configure() -#endif + return true }