Skip to content

Commit a8dd5f1

Browse files
MacOS auth issue fix. (#7050)
* MacOS auth issue fix. On MacOS 11 catalyst apps when trying to open SFSafariViewController the default browser opens and the safariViewControllerDidFinish(_ controller: SFSafariViewController) delegate method calls immediately. * TARGET_OS_MACCATALYST usige style fixed. * Fix elif macro issue. * Fixed wrong file changes. * Fix formatting. Co-authored-by: Vahagn Gevorgyan <[email protected]>
1 parent 565cd8a commit a8dd5f1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

FirebaseAuth/Sources/Utilities/FIRAuthURLPresenter.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ - (void)presentURL:(NSURL *)URL
9191
_completion = [completion copy];
9292
dispatch_async(dispatch_get_main_queue(), ^() {
9393
self->_UIDelegate = UIDelegate ?: [FIRAuthDefaultUIDelegate defaultUIDelegate];
94+
#if TARGET_OS_MACCATALYST
95+
self->_webViewController = [[FIRAuthWebViewController alloc] initWithURL:URL delegate:self];
96+
UINavigationController *navController =
97+
[[UINavigationController alloc] initWithRootViewController:self->_webViewController];
98+
[self->_UIDelegate presentViewController:navController animated:YES completion:nil];
99+
#else
94100
if ([SFSafariViewController class]) {
95101
self->_safariViewController = [[SFSafariViewController alloc] initWithURL:URL];
96102
self->_safariViewController.delegate = self;
@@ -104,6 +110,7 @@ - (void)presentURL:(NSURL *)URL
104110
[[UINavigationController alloc] initWithRootViewController:self->_webViewController];
105111
[self->_UIDelegate presentViewController:navController animated:YES completion:nil];
106112
}
113+
#endif
107114
});
108115
}
109116

0 commit comments

Comments
 (0)