我正在创建一个ASWebAuthenticationSession会话,在完成处理程序中,我有一些清理任务,用于在用户取消登录时进行清理:
let session = ASWebAuthenticationSession(url: url, callbackURLScheme: redirectURI) { (callbackURL: URL?, error: Error?) in
if case .ASWebAuthenticationSessionError.canceledLogin? = error {
// clean up tasks
}
我在使用用于iOS应用程序中OAuth2进程的新ASWebAuthenticationSession类时遇到了问题。 我想使用这个类将我的应用程序与我的Strava帐户连接起来。我有以下代码: class AuthController
{
private var authSession: ASWebAuthenticationSession?
func authenticate()
{
let string = self.createWebAuthUrl()
guard let url = URL(string: string) el