Monday, 21 October 2019

ASWebAuthenticationSession is not completing

I'm using ASWebAuthenticationSession to OAuth against Facebook and everything goes well until the callback URL loads, where you would expect the completionHandler to be called but it isn't. In the end, all you can do is cancel the window.

This is a problem for either iOS 12.4 or 13.1 (latest of each major, as of writing). The function getting called is as follows:

let authURL = URL(string: url)
let callbackUrlScheme = "https://somedomain.com/authcallback"

self.webAuthSession = ASWebAuthenticationSession.init(url: authURL!,
callbackURLScheme: callbackUrlScheme, completionHandler: { (callBack:URL?, error:Error?) in
(...)
})

In iOS 13, I'm taking care of implementing the required interface ASWebAuthenticationPresentationContextProviding. Regardless, this problem still occurs in iOS 12. I'm lost on how to proceed with this.

Running Xcode Version 11.1 (11A1027) on macOS 10.14.6 (18G103).



from ASWebAuthenticationSession is not completing

No comments:

Post a Comment