Skip to content

Commit f1688e7

Browse files
committed
🐛 open safariViewController from main thread
implement fix from fullstackreact#150
1 parent 2321107 commit f1688e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ios/OAuthManager/OAuthManager.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ + (BOOL)setupOAuthHandler:(UIApplication *)application
8888
[authPlatform setURLOpener: ^void(NSURL *URL, DCTAuthPlatformCompletion completion) {
8989
// [sharedManager setPendingAuthentication:YES];
9090
if ([SFSafariViewController class] != nil) {
91+
dispatch_async(dispatch_get_main_queue(), ^{
9192
safariViewController = [[SFSafariViewController alloc] initWithURL:URL];
9293
UIViewController *viewController = application.keyWindow.rootViewController;
9394
[viewController presentViewController:safariViewController animated:YES completion: nil];
95+
});
9496
} else {
9597
[application openURL:URL];
9698
}

0 commit comments

Comments
 (0)