I am trying to get more information than just a Facebook user's id when they log in. I am using Parse to create users, and I would like to store their first and last name, as well as email. I read that this information is part of the public_profile but only the Facebook id is stored. Below is the code that I'm using when the user presses the "Log in with Facebook" button.
This is probably similar to this question, but any help would be greatly appreciated. This has nothing to do with accessing Facebook's api, I'm looking for help with Parse.
// login with Facebook button
@IBAction func FBLoginPressed(sender: AnyObject) {
// permissions for Facebook login
let permissions = ["public_profile", "email", "first_name"]
// call Facebook log in when button is pressed
PFFacebookUtils.logInWithPermissions(permissions, {
(user: PFUser!, error: NSError!) -> Void in
if user == nil {
NSLog("User cancelled the Facebook login.")
} else if user.isNew {
NSLog("User signed up and logged in through Facebook.")
} else {
NSLog("User logged in through Facebook.")
}
})
}