From 754ffab4829ec20e71c0f753bb9c6fc5b42ca196 Mon Sep 17 00:00:00 2001 From: Isidro Henoch Date: Sat, 12 Feb 2022 18:33:50 -0600 Subject: Fixes the issue with Firebase not initializing --- iosApp/iosApp/AppDelegate.swift | 5 ++++- iosApp/iosApp/iOSApp.swift | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iosApp/iosApp/AppDelegate.swift b/iosApp/iosApp/AppDelegate.swift index ebe88df..4233910 100644 --- a/iosApp/iosApp/AppDelegate.swift +++ b/iosApp/iosApp/AppDelegate.swift @@ -21,7 +21,8 @@ import Firebase import FirebaseMessaging class AppDelegate: NSObject, UIApplicationDelegate { - func applicationDidFinishLaunching(_ application: UIApplication) { + func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { FirebaseApp.configure() Messaging.messaging().delegate = self @@ -30,6 +31,8 @@ class AppDelegate: NSObject, UIApplicationDelegate { UNUserNotificationCenter.current().requestAuthorization(options: authOptions) { _, _ in } application.registerForRemoteNotifications() + + return true } func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult { diff --git a/iosApp/iosApp/iOSApp.swift b/iosApp/iosApp/iOSApp.swift index 291f2cd..763e0e2 100644 --- a/iosApp/iosApp/iOSApp.swift +++ b/iosApp/iosApp/iOSApp.swift @@ -21,7 +21,7 @@ import shared @main struct iOSApp: App { - @UIApplicationDelegateAdaptor var delegate: AppDelegate + @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate init() { /* Dependency injections */ -- cgit v1.2.3