Skip to content

Commit

Permalink
🐛 open safariViewController from main thread
Browse files Browse the repository at this point in the history
implement fix from fullstackreact#150
  • Loading branch information
blakek committed Jan 11, 2018
1 parent 2321107 commit f1688e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ios/OAuthManager/OAuthManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ + (BOOL)setupOAuthHandler:(UIApplication *)application
[authPlatform setURLOpener: ^void(NSURL *URL, DCTAuthPlatformCompletion completion) {
// [sharedManager setPendingAuthentication:YES];
if ([SFSafariViewController class] != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
safariViewController = [[SFSafariViewController alloc] initWithURL:URL];
UIViewController *viewController = application.keyWindow.rootViewController;
[viewController presentViewController:safariViewController animated:YES completion: nil];
});
} else {
[application openURL:URL];
}
Expand Down

0 comments on commit f1688e7

Please sign in to comment.