我正在尝试使用新的Firebase平台创建Facebook登录。
以下是Facebook登录的代码:
let facebookLogin = FBSDKLoginManager()
facebookLogin.logInWithReadPermissions(["email"], fromViewController: self) { (result, error) -> Void in
if error != nil {
print("error is \(error)")
} else {
let accessToken = FBSDKAccessToken.currentAccessToken().tokenString
let credential = FIRFacebookAuthProvider.credentialWithAccessToken(accessToken)
AUTH?.signInWithCredential(credential, completion: { (user, error) -> Void in
if error != nil {
print("error is \(error)")
} else {
print(user)
NSUserDefaults.standardUserDefaults().setValue(user?.uid, forKey: KEY_UID)
self.performSegueWithIdentifier(SEGUE_LOGGEDIN, sender: nil)
}
})
}
这是我收到的错误代码
可选(错误域=FIRAuthErrorDomain Code=17999 "发生了内部错误,请打印并检查错误详细信息以获取更多信息。" UserInfo={error_name=ERROR_INTERNAL_ERROR, NSUnderlyingError=0x79f082b0 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey={type = 不可变字典, count = 3, entries =>
0 : {contents = "errors"} = {type = 不可变, count = 1, values = (
0 : {type = 不可变字典, count = 3, entries =>
0 : {contents = "reason"} = {contents = "invalid"}
1 : {contents = "message"} = {contents = "从Facebook获取debug_token失败:{“error”:{“message”:“无效的OAuth访问令牌签名。”,“type”:“OAuthException”,“code”:190,“fbtrace_id”:“BrewfOSy / fH”}}"}
2 : {contents = "domain"} = {contents = "global"} }
)}
1 : {contents = "code"} = {value = +400,type = kCFNumberSInt64Type}
2 : {contents = "message"} = {contents = "从Facebook获取debug_token失败:{“error”:{“message”:“无效的OAuth访问令牌签名。”,“type”:“OAuthException”,“code”:190,“fbtrace_id”:“BrewfOSy / fH”}}"}
},NSLocalizedDescription=发生了内部错误,请打印并检查错误详细信息以获取更多信息。})