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
In Swift, you can make a Graph request(as shown by @RageCompex) from the login button's didCompleteWithResult
callback.
func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginManagerLoginResult!, error: NSError!)
{
print(result.token.tokenString) //YOUR FB TOKEN
let req = FBSDKGraphRequest(graphPath: "me", parameters: ["fields":"email,name"], tokenString: result.token.tokenString, version: nil, HTTPMethod: "GET")
req.startWithCompletionHandler({ (connection, result, error : NSError!) -> Void in
if(error == nil)
{
print("result \(result)")
}
else
{
print("error \(error)")
}
})
}