Completion handler does not fire dongri / OAuthSwift

I am having a hard time implementing OAuth2 in my quick project. I am currently using https://github.com/dongri/OAuthSwift and although I can successfully authorize the user, I cannot run the completion handler, for example if I were to enable the method println()

on success or failure, it prints nothing on the console. If anyone can help me with this, that would be awesome.

//OAuth2.0

    oauthswift.authorize_url_handler = webViewController()
    let state: String = generateStateWithLength(20) as String


    oauthswift.authorizeWithCallbackURL(NSURL(string: "oauth-swift://oauth-callback/github")!, scope: "user,repo", state: state,
        success: {(credential: OAuthSwiftCredential, response: NSURLResponse?, parameters: NSDictionary) in


            println("success")

        },
        failure: {(error: NSError) -> Void in
            println("fail")
    })

      

+3


source to share





All Articles