From ade83e99f7c6968da4841a4dcd0e41def528f176 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:42:48 -0400 Subject: [PATCH] [Auth] When swizzling is disabled, open URLs via SceneDelegate (#13557) --- .../AuthenticationExample/SceneDelegate.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SceneDelegate.swift b/FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SceneDelegate.swift index ae49583311a..e7965767a8a 100644 --- a/FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SceneDelegate.swift +++ b/FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SceneDelegate.swift @@ -48,6 +48,17 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { window?.makeKeyAndVisible() } + // Implementing this delegate method is needed when swizzling is disabled. + // Without it, reCAPTCHA's login view controller will not dismiss. + func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { + for urlContext in URLContexts { + let url = urlContext.url + _ = Auth.auth().canHandle(url) + } + + // URL not auth related; it should be handled separately. + } + func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { if let incomingURL = userActivity.webpageURL { handleIncomingDynamicLink(incomingURL)