简体   繁体   中英

Swift 5 - Facebook Login: LoginManager() always return cancelled

I follow this tutorial and I got this error msg from xcode, please help.

FBSDKLog: There is already a request for authenticated session. Cancelling active SFAuthenticationSession before starting the new one.

You can do the following...

let manager = LoginManager() // create object of LoginManager class
manager.logOut() //<- Logout if there is any existing session
manager.logIn(permissions: ["public_profile", "email"], from: self) { (result, error) in


   //your code goes here...

}                                                              

The FBLoginButton automatically starts the authentication session. Make sure you aren't calling FBSDKLoginKit.LoginManager().login() as a part of your button action. Instead, conform to LoginButtonDelegate to handle the result from the authentication session that results from the button tap.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM