0
我在轉到Swift 3後面臨一個問題 - 在用戶單擊連接到Facebook登錄按鈕後,沒有任何反應。登錄到Facebook後未登錄到Firebase Swift 3
這是移動到斯威夫特3後,我的代碼:
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
print("user logged in")
self.loginButton.isHidden = true
activityIndicator.startAnimating()
if error != nil {
self.loginButton.isHidden = false
activityIndicator.stopAnimating()
print("???")
//handle errors
} else if result.isCancelled {
self.loginButton.isHidden = false
activityIndicator.stopAnimating()
let loginManager = FBSDKLoginManager()
loginManager.logOut()
//handle cancel
print("canceled")
} else {
let credential = FIRFacebookAuthProvider.credential(withAccessToken: FBSDKAccessToken.current().tokenString)
FIRAuth.auth()?.signIn(with: credential) { (user, error) in
print("user logged to firebase app")
}
}
它不打印user logged in
,也不能打印user logged to firebase app