Вы можете получить данные таким способом.но вам нужно установить новую последнюю библиотеку с пакетом или вручную
import FBSDKLoginKit
func signInWithFB(_ forVC:UIViewController , sucess:@escaping (_ data:NSMutableDictionary) -> (Void) , falure:@escaping (_ error:NSError? , _ cancle:Bool?) -> (Void))
{
let obj_facebook = FBSDKLoginManager()
obj_facebook.loginBehavior = .native
obj_facebook.logOut()
// "user_birthday","user_gender"
obj_facebook.logIn(withReadPermissions: ["public_profile","email"], from: forVC) { (result:FBSDKLoginManagerLoginResult?, error:Error?) -> Void in
if ((error) != nil)
{
falure(error as NSError?, false)
}
else if ((result?.isCancelled) == true)
{
falure(nil, true)
}
else
{
let dicLoginData = NSMutableDictionary()
// name,email,first_name,last_name,birthday
let request = FBSDKGraphRequest(graphPath: "/me?fields=name,email,first_name,last_name", parameters: nil)
let _ =
request?.start(completionHandler: { (Connection:FBSDKGraphRequestConnection?, result:Any!, error:Error?) -> Void in
if error == nil
{
guard let results = result as? [String: Any] else {
falure(nil, false)
return
}
sucess(result)
}
else
{
falure(error as NSError?, false)
}
})
}
}
}