Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge browser support for iOS #868

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ API_UNAVAILABLE(macCatalyst)
*/
+ (instancetype)CustomBrowserSafari;

/*! @brief An instance of @c OIDExternalUserAgentIOSCustomBrowser for Edge.
*/
+ (instancetype)CustomBrowserEdge;

/*! @brief Creates a @c OIDCustomBrowserURLTransformation using the scheme substitution method used
iOS browsers like Chrome and Firefox.
*/
Expand Down
10 changes: 10 additions & 0 deletions Sources/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ + (instancetype)CustomBrowserSafari {
return transform;
}

+ (instancetype)CustomBrowserEdge {
OIDCustomBrowserURLTransformation transform =
[[self class] URLTransformationSchemeSubstitutionHTTPS:@"edge-https" HTTP:@"edge-http"];
NSURL *appStoreURL =
[NSURL URLWithString:@"https://apps.apple.com/us/app/microsoft-edge-web-browser/id1288723196"];
return [[[self class] alloc] initWithURLTransformation:transform
canOpenURLScheme:@"edge-https"
appStoreURL:appStoreURL];
}

+ (OIDCustomBrowserURLTransformation)
URLTransformationSchemeSubstitutionHTTPS:(NSString *)browserSchemeHTTPS
HTTP:(nullable NSString *)browserSchemeHTTP {
Expand Down