Skip to content

Commit 8a035f7

Browse files
Denisossus-lib
authored andcommitted
Mac Catalyst support (p2#328)
1 parent c1cf4e9 commit 8a035f7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/iOS/OAuth2Authorizer+iOS.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,19 @@ open class OAuth2Authorizer: OAuth2AuthorizerUI {
146146
}
147147
self.authenticationSession = nil
148148
}
149-
149+
150+
#if targetEnvironment(macCatalyst)
151+
authenticationSession = ASWebAuthenticationSession(url: url, callbackURLScheme: redirect, completionHandler: completionHandler)
152+
return (authenticationSession as! ASWebAuthenticationSession).start()
153+
#else
150154
if #available(iOS 12, *) {
151155
authenticationSession = ASWebAuthenticationSession(url: url, callbackURLScheme: redirect, completionHandler: completionHandler)
152156
return (authenticationSession as! ASWebAuthenticationSession).start()
153157
} else {
154158
authenticationSession = SFAuthenticationSession(url: url, callbackURLScheme: redirect, completionHandler: completionHandler)
155159
return (authenticationSession as! SFAuthenticationSession).start()
156160
}
161+
#endif
157162
}
158163

159164

0 commit comments

Comments
 (0)