Get email and name Facebook SDK v4.4.0 Swift

前端 未结 10 2137
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-08 02:22

TL;TR: How do I get the email and name of a user that is logged in on my app using the facebook SDK 4.4

So far I have managed to get login working, now I can get the

10条回答
  •  佛祖请我去吃肉
    2020-12-08 02:53

    facebook ios sdk get user name and email swift 3

    FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "id, name, first_name, last_name, email"]).start(completionHandler: { (connection, result, error) -> Void in
            if (error == nil) {
                let fbDetails = result as! NSDictionary
                print(fbDetails)
            } else {
                print(error?.localizedDescription ?? "Not found")
            }
        })
    

提交回复
热议问题