title: Using Swift, Parse and the iOS FacebookSDK, how do I obtain user's name and email at login?
body: <p>So I've been banging my head on this for a couple days now, and I'm hoping someone here could shed some light on this for me!</p>
  
  <p>So I'm using Parse in my Swift project, and am looking to leverage the Facebook integration to make logging in and signing up a user pretty effortless.</p>
  
  <p>I have managed to get as far as logging in a user, but the part where I'm stuck is that I don't know how to access the data that I requested with permissions.</p>
  
  <p>In my AppDelegate Swift file, I have this block of code..</p>
  
  <pre><code>// INITIALISE FACEBOOK
      let permissions = ["email", "public_profile"]
      PFFacebookUtils.initializeFacebook()
      PFFacebookUtils.logInWithPermissions(permissions, {
          (user: PFUser!, error: NSError!) -&gt; Void in
          if user == nil {
              if (error == nil) {
                  println("User cancelled Facebook login")
              } else {
                  println("FB Login Error \n(error)")
              }
          } else if user.isNew {
                  println("User has signed in through Facebook!")
          } else {
              println("User logged in through Facebook!")
          }
      })
  </code></pre>
  
  <p>Everything is all well and dandy, and I get the "User has signed in through Facebook!" message.
  According to the Parse documentation, this then creates a new User object in my database.</p>
  
  <p>In my database, I see that there is indeed a new user, but the only fields that are populated are..</p>
  
  <ul>
  <li>ObjectID - random string characters </li>
  <li>username - random string characters</li>
  <li>authData - a facebook type ID.</li>
  </ul>
  
  <p>Not the username or email.</p>
  
  <p>From what I have gathered, I need to now further leverage the FacebookSDK and GraphUser, but I really dont know exactly how.. or at least not in Swift.</p>
  
  <p>The Parse documentation says</p>
  
  <blockquote>
    <p><em>"The Facebook iOS SDK provides a number of helper classes for interacting with Facebook's API. Generally, you will use the FBRequest class to interact with Facebook on behalf of your logged-in user. You can read more about the Facebook SDK here.<br>
    Our library manages the user's FBSession object for you. You can simply call [PFFacebookUtils session] to access the session instance, which can then be passed to FBRequests."</em></p>
  </blockquote>
  
  <p>But I really dont know what to type or where to type it. :(
  It feels like I'm really close with this, but I'm just hitting blanks..</p>
  
  <p>If someone could be kind enough to shed some light into this (how to access the details I requested permission for, i.e. full name and email) I would be incredibly grateful!</p>
  
  <p>Thank you.. :)</p>