Skip to content

Commit 820507d

Browse files
authored
Update OIDExternalUserAgentIOSCustomBrowser.m
1 parent e05582b commit 820507d

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

Sources/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,17 @@ - (BOOL)presentExternalUserAgentRequest:(nonnull id<OIDExternalUserAgentRequest>
145145
NSString *testURLString = [NSString stringWithFormat:@"%@://example.com", _canOpenURLScheme];
146146
NSURL *testURL = [NSURL URLWithString:testURLString];
147147
if (![[UIApplication sharedApplication] canOpenURL:testURL]) {
148-
if (@available(iOS 10.0, *)) {
149-
[[UIApplication sharedApplication] openURL:_appStoreURL options:@{} completionHandler:nil];
150-
} else {
151-
[[UIApplication sharedApplication] openURL:_appStoreURL];
152-
}
148+
[[UIApplication sharedApplication] openURL:_appStoreURL options:@{} completionHandler:nil];
153149
return NO;
154150
}
155151
}
156-
152+
157153
// Transforms the request URL and opens it.
158154
NSURL *requestURL = [request externalUserAgentRequestURL];
159155
requestURL = _URLTransformation(requestURL);
160-
if (@available(iOS 10.0, *)) {
161-
BOOL willOpen = [[UIApplication sharedApplication] canOpenURL:requestURL];
162-
[[UIApplication sharedApplication] openURL:requestURL options:@{} completionHandler:nil];
163-
return willOpen;
164-
} else {
165-
BOOL openedInBrowser = [[UIApplication sharedApplication] openURL:requestURL];
166-
return openedInBrowser;
167-
}
156+
BOOL willOpen = [[UIApplication sharedApplication] canOpenURL:requestURL];
157+
[[UIApplication sharedApplication] openURL:requestURL options:@{} completionHandler:nil];
158+
return willOpen;
168159
}
169160

170161
- (void)dismissExternalUserAgentAnimated:(BOOL)animated

0 commit comments

Comments
 (0)