File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ Contributors
33
44Contributors to the codebase, in reverse chronological order:
55
6+ - Maxime Le Moine, @MaximeLM
67- Seb Skuse, @sebskuse
78- David Hardiman, @dhardiman
89- Amaury David, @amaurydavid
Original file line number Diff line number Diff line change @@ -55,17 +55,13 @@ open class OAuth2Authorizer: OAuth2AuthorizerUI {
5555 */
5656 public func openAuthorizeURLInBrowser( _ url: URL ) throws {
5757
58- // By asking for the shared instance method by using the "value for key" method on UIApplication, we are able to
59- // bypass the Swift compilation restriction that blocks the library from being compiled for an extension when
60- // directly referencing it. We do it as an optional so in the advent of this method being called, like in an
61- // extension, we handle it as though its not supported.
62- guard let application = UIApplication . value ( forKey: " sharedApplication " ) as? UIApplication else {
63- throw OAuth2Error . unableToOpenAuthorizeURL
64- }
65-
66- if !application. openURL ( url) {
58+ #if !P2_APP_EXTENSIONS
59+ if !UIApplication. shared. openURL ( url) {
6760 throw OAuth2Error . unableToOpenAuthorizeURL
6861 }
62+ #else
63+ throw OAuth2Error . unableToOpenAuthorizeURL
64+ #endif
6965 }
7066
7167 /**
You can’t perform that action at this time.
0 commit comments