FBSDKLog: Cannot login without a valid login configuration. Please make sure the `LoginConfiguration` provided is non-nil

Viewed 826

I have this message on my console "FBSDKLog: Cannot login without a valid login configuration. Please make sure the LoginConfiguration provided is non-nil" when in simulator i tap the button "Continue with facebook" since I add this code, can somebody please tell me what the problem, sorry I'm new one(very new one)

extension LoginViewController: LoginButtonDelegate {
    func loginButtonDidLogOut(_ loginButton: FBLoginButton) {
        // no operation
    }
    func loginButton(_ loginButton: FBLoginButton, didCompleteWith result: LoginManagerLoginResult?, error: Error?) {
        guard let token = result?.token?.tokenString else {
            print("Не удалось войти через Facebook")
            return
        }
        
        let credential = FacebookAuthProvider.credential(withAccessToken: token)
        
        FirebaseAuth.Auth.auth().signIn(with: credential, completion: { [weak self] authResult, error in
            guard let strongSelf = self else {
                return
            }
            
            guard authResult != nil, error == nil else {
                print("Не удалось войти с учетными данными Facebook, возможно нужна многофакторная аутентификация")
                
                return
            }
            
            print("Успешный вход пользователя")
            strongSelf.navigationController?.dismiss(animated: true, completion: nil)
        })
    }
    
}
1 Answers

Set this in your loginViewController facebook button:

loginButton.permissions = ["public_profile", "email"]

I had the same issue, it was solved by this

Related