gpt4 book ai didi

ios - Firebase signInWithCredential 使用 Facebook SDK 给出错误

转载 作者:行者123 更新时间:2023-11-28 15:42:50 32 4
gpt4 key购买 nike

我在 iOS 中使用 swift 语言使用 Firebase。我正在尝试使用 Facebook 登录。我正在使用 graphRequest 获取 FBSDKAccessToken。当我使用 Facebook 的 Firebase 登录方法时出现以下错误

 UserInfo={NSUnderlyingError=0x608000059560 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)"
UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey={
code = 400;
errors = (
{
domain = global;
message = "Unsuccessful debug_token response from Facebook: {\"error\":{\"message\":\"(#4) Application request limit
reached\",\"type\":\"OAuthException\",\"is_transient\":true,\"code\":4,\"fbtrace_id\":\"En2h2Q0L7TP\"}}";
reason = invalid;
}
);
message = "Unsuccessful debug_token response from Facebook: {\"error\":{\"message\":\"(#4) Application request limit
reached\",\"type\":\"OAuthException\",\"is_transient\":true,\"code\":4,\"fbtrace_id\":\"En2h2Q0L7TP\"}}";
}}}, error_name=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for
more information.}

我的完整代码是

    {
let login : FBSDKLoginManager = FBSDKLoginManager()
login.logOut()
login.logInWithReadPermissions(["public_profile","email"], fromViewController: self, handler: { (result, error) -> Void in
if (error == nil){
let request: FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "id,email,first_name,middle_name,last_name,picture"], HTTPMethod: "GET")
request.startWithCompletionHandler({ (connection : FBSDKGraphRequestConnection!, result : AnyObject!, error : NSError!) -> Void in
if error == nil
{
let userDetail : NSDictionary = result as! NSDictionary




let token = FBSDKAccessToken.currentAccessToken().tokenString

let credential = FIRFacebookAuthProvider.credentialWithAccessToken(token)
FIRAuth.auth()?.signInWithCredential(credential, completion: { (user, error) in

if error == nil
{

let homeVC = self.storyboard?.instantiateViewControllerWithIdentifier("PageController") as? PageController
self.navigationController?.pushViewController(homeVC!, animated: true)

print(userDetail)
}
else
{
print("Signing Failed ")

}


})



}
else
{
print("Error Getting Info \(error)");
}
})
}else{
print("Login Failed")
}
})

return;
}

最佳答案

我已经通过更改 info.plist 和 URL 中的 FacebookAppID 解决了这个问题
我使用了与 Firebase 应用程序无关的那个。 (旧的)

这是我的登录流程
1) fbLoginManager.login
2) let credential = FacebookAuthProvider.credential(withAccessToken: FBSDKAccessToken.current().tokenString)
3) Auth.auth().signIn(with: credential)

关于ios - Firebase signInWithCredential 使用 Facebook SDK 给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43519458/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com