1

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.")
        }
    })  
}
Community
  • 1
  • 1
atwalsh
  • 3,622
  • 1
  • 19
  • 38
  • Thanks. I did not see this when I was searching around. I will attempt it with that post. – atwalsh Jan 28 '15 at 22:47
  • 1
    The suggested duplicate is not a dupe. It uses a different language, API and retrieves different data fields than @atwalsh04 is looking for. – JasonMArcher Jan 29 '15 at 19:56
  • @JasonMArcher is correct. I have edited the question to explain I am looking for help with Parse Users and the swift language. – atwalsh Jan 29 '15 at 20:20

0 Answers0