Skip to content

Commit

Permalink
Merge branch 'master' of github.com:openid/AppAuth-iOS into jg/update…
Browse files Browse the repository at this point in the history
…-175
  • Loading branch information
Lucien committed Nov 13, 2024
2 parents a70b527 + b856e4b commit d72e692
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ jobs:
run: pod lib lint --verbose ${{ matrix.flags }}

spm-build-test:
runs-on: macos-11
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build unit test target
run: swift build
- name: Run unit test target
run: swift test --enable-code-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
version: v0.7.3
16 changes: 13 additions & 3 deletions Sources/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,26 @@ - (BOOL)presentExternalUserAgentRequest:(nonnull id<OIDExternalUserAgentRequest>
NSString *testURLString = [NSString stringWithFormat:@"%@://example.com", _canOpenURLScheme];
NSURL *testURL = [NSURL URLWithString:testURLString];
if (![[UIApplication sharedApplication] canOpenURL:testURL]) {
[[UIApplication sharedApplication] openURL:_appStoreURL];
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:_appStoreURL options:@{} completionHandler:nil];
} else {
[[UIApplication sharedApplication] openURL:_appStoreURL];
}
return NO;
}
}

// Transforms the request URL and opens it.
NSURL *requestURL = [request externalUserAgentRequestURL];
requestURL = _URLTransformation(requestURL);
BOOL openedInBrowser = [[UIApplication sharedApplication] openURL:requestURL];
return openedInBrowser;
if (@available(iOS 10.0, *)) {
BOOL willOpen = [[UIApplication sharedApplication] canOpenURL:requestURL];
[[UIApplication sharedApplication] openURL:requestURL options:@{} completionHandler:nil];
return willOpen;
} else {
BOOL openedInBrowser = [[UIApplication sharedApplication] openURL:requestURL];
return openedInBrowser;
}
}

- (void)dismissExternalUserAgentAnimated:(BOOL)animated
Expand Down

0 comments on commit d72e692

Please sign in to comment.