Skip to content

Commit 7340c71

Browse files
authored
Merge pull request #188 from represent/master
Use asynchronous execution for safariViewController
2 parents 77128e0 + 1d7f49e commit 7340c71

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ios/OAuthManager/OAuthManager.m

Lines changed: 5 additions & 3 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-
safariViewController = [[SFSafariViewController alloc] initWithURL:URL];
92-
UIViewController *viewController = application.keyWindow.rootViewController;
93-
[viewController presentViewController:safariViewController animated:YES completion: nil];
91+
dispatch_async(dispatch_get_main_queue(), ^{
92+
safariViewController = [[SFSafariViewController alloc] initWithURL:URL];
93+
UIViewController *viewController = application.keyWindow.rootViewController;
94+
[viewController presentViewController:safariViewController animated:YES completion: nil];
95+
});
9496
} else {
9597
[application openURL:URL];
9698
}

0 commit comments

Comments
 (0)