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
For Swift 3 & Facebook SDK 4.16.0:
func getFBUserInfo() {
let request = GraphRequest(graphPath: "me", parameters: ["fields":"email,name"], accessToken: AccessToken.current, httpMethod: .GET, apiVersion: FacebookCore.GraphAPIVersion.defaultVersion)
request.start { (response, result) in
switch result {
case .success(let value):
print(value.dictionaryValue)
case .failed(let error):
print(error)
}
}
}
and will print:
Optional(["id": 1xxxxxxxxxxxxx, "name": Me, "email": stackoverflow@gmail.com])