0

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.

Mahendra
  • 8,448
  • 3
  • 33
  • 56
Sen-He Lee
  • 134
  • 1
  • 13

2 Answers2

1

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...

}                                                              
Dharmesh Mansata
  • 4,422
  • 1
  • 27
  • 33
Mahendra
  • 8,448
  • 3
  • 33
  • 56
0

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.