gpt4 book ai didi

ios - iOS 的 Facebook 登录错误 : The operation couldn’t be completed.(com.facebook.sdk.core 错误 3.)

转载 作者:可可西里 更新时间:2023-11-01 00:59:16 26 4
gpt4 key购买 nike

我收到错误代码:

The operation couldn’t be completed. (com.facebook.sdk.core error 3.)

用于在我的应用程序上登录 facebook,我不确定为什么。这是我的 View Controller 代码:

import FBSDKCoreKit
import FBSDKLoginKit

@IBOutlet weak var facebookLoginButton: FBSDKLoginButton!


override func viewDidLoad() {
super.viewDidLoad()

facebookLoginButton.readPermissions = ["public_profile", "email", "user_friends"]
facebookLoginButton.delegate = self

}

//MARK: Facebook Login

func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginManagerLoginResult!, error: NSError!) {
if error == nil {

print("Login Complete")

performSegueWithIdentifier("facebookSegue", sender: self)

} else {

print(error.localizedDescription)

}
}

func loginButtonDidLogOut(loginButton: FBSDKLoginButton!) {
print("User logged out")
}

这是 appDelegate:

import FBSDKCoreKit

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.

//Facebook login
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {

//Facebook login
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}

我认为代码是正确的,但也许我遗漏了什么,感谢任何帮助!

最佳答案

如果您将 Facebook iOS SDK 升级到版本 4.39.0,则存在导致此错误的错误。降级到 4.38.1 将帮助您解决这个问题。请务必同时降级 FBSDKCoreKit 和 FBSDKLoginKit。

pod 'FBSDKCoreKit', '~> 4.38.0'
pod 'FBSDKLoginKit', '~> 4.38.0'

请务必清理构建文件夹并重新构建 SDK。

关于ios - iOS 的 Facebook 登录错误 : The operation couldn’t be completed.(com.facebook.sdk.core 错误 3.),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37758686/

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