From 2ab546097ad4a6593f64b6e6e42d43d19d40a994 Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 25 Dec 2021 23:04:26 -0800 Subject: [PATCH] moving it around as I found a bug but I was not able to reproduce so won't change... --- nirvana-ios/nirvana_iosApp.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nirvana-ios/nirvana_iosApp.swift b/nirvana-ios/nirvana_iosApp.swift index 55e2b76..2b63f8f 100644 --- a/nirvana-ios/nirvana_iosApp.swift +++ b/nirvana-ios/nirvana_iosApp.swift @@ -72,6 +72,12 @@ class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didReceiveRemoteNotification notification: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { print("did receive remote notification") + // phone auth + if Auth.auth().canHandleNotification(notification) { + completionHandler(.noData) + return + } + // If you are receiving a notification message while your app is in the background, // this callback will not be fired till the user taps on the notification launching the application. // TODO: Handle data of notification @@ -88,12 +94,6 @@ class AppDelegate: NSObject, UIApplicationDelegate { print(notification) completionHandler(UIBackgroundFetchResult.newData) - - // phone auth - if Auth.auth().canHandleNotification(notification) { - completionHandler(.noData) - return - } } // For iOS 9+