@@ -70,7 +70,7 @@ + (BOOL)requiresMainQueueSetup
70
70
BOOL ephemeralWebSession = [options[@" ephemeralWebSession" ] boolValue ];
71
71
72
72
if (@available (iOS 11 , *)) {
73
- NSURL *url = [[NSURL alloc ] initWithString: authURL];
73
+ NSURL *url = [[NSURL alloc ] initWithString: authURL];
74
74
__weak typeof (self) weakSelf = self;
75
75
void (^completionHandler)(NSURL * _Nullable, NSError *_Nullable) = ^(NSURL * _Nullable callbackURL, NSError * _Nullable error) {
76
76
__strong typeof (weakSelf) strongSelf = weakSelf;
@@ -151,24 +151,24 @@ + (BOOL)requiresMainQueueSetup
151
151
modalEnabled = [options[@" modalEnabled" ] boolValue ];
152
152
animated = [options[@" animated" ] boolValue ];
153
153
154
- // Safari View Controller to authorize request
155
- NSURL *url = [[ NSURL alloc ] initWithString: authURL];
156
- if (@ available (iOS 11.0 , *)) {
157
- SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc ] init ];
158
- config. barCollapsingEnabled = enableBarCollapsing ;
159
- config.entersReaderIfAvailable = readerMode ;
160
- @try {
154
+ @try {
155
+ // Safari View Controller to authorize request
156
+ NSURL *url = [[ NSURL alloc ] initWithString: authURL];
157
+ if (@ available (iOS 11.0 , *)) {
158
+ SFSafariViewControllerConfiguration * config = [[SFSafariViewControllerConfiguration alloc ] init ] ;
159
+ config.barCollapsingEnabled = enableBarCollapsing ;
160
+ config. entersReaderIfAvailable = readerMode;
161
161
safariVC = [[SFSafariViewController alloc ] initWithURL: url configuration: config];
162
+ } else {
163
+ safariVC = [[SFSafariViewController alloc ] initWithURL: url entersReaderIfAvailable: readerMode];
162
164
}
163
- @catch (NSException *exception) {
164
- reject (RNInAppBrowserErrorCode, @" Unable to open url." , nil );
165
- [self _close ];
166
- NSLog (@" CRASH: %@ " , exception);
167
- NSLog (@" Stack Trace: %@ " , [exception callStackSymbols ]);
168
- return ;
169
- }
170
- } else {
171
- safariVC = [[SFSafariViewController alloc ] initWithURL: url entersReaderIfAvailable: readerMode];
165
+ }
166
+ @catch (NSException *exception) {
167
+ reject (RNInAppBrowserErrorCode, @" Unable to open url." , nil );
168
+ [self _close ];
169
+ NSLog (@" CRASH: %@ " , exception);
170
+ NSLog (@" Stack Trace: %@ " , [exception callStackSymbols ]);
171
+ return ;
172
172
}
173
173
safariVC.delegate = self;
174
174
if (@available (iOS 11.0 , *)) {
0 commit comments