Skip to content

Commit e466698

Browse files
committed
Fix for safari crash
- Use this forked lib until this bug is fixed: https://github.com/fullstackreact/react-native-oauth/pull/150/files
1 parent 2a1fb1b commit e466698

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ios/OAuthManager/OAuthManager.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@ + (BOOL)setupOAuthHandler:(UIApplication *)application
8787

8888
[authPlatform setURLOpener: ^void(NSURL *URL, DCTAuthPlatformCompletion completion) {
8989
// [sharedManager setPendingAuthentication:YES];
90+
// We have to use this forked library until this is fixed.
91+
// https://github.com/fullstackreact/react-native-oauth/pull/150/files
9092
if ([SFSafariViewController class] != nil) {
91-
safariViewController = [[SFSafariViewController alloc] initWithURL:URL];
92-
UIViewController *viewController = application.keyWindow.rootViewController;
93-
[viewController presentViewController:safariViewController animated:YES completion: nil];
93+
dispatch_async(dispatch_get_main_queue(), ^{
94+
safariViewController = [[SFSafariViewController alloc] initWithURL:URL];
95+
UIViewController *viewController = application.keyWindow.rootViewController;
96+
[viewController presentViewController:safariViewController animated:YES completion: nil];
97+
});
9498
} else {
9599
[application openURL:URL];
96100
}

0 commit comments

Comments
 (0)