I am creating an application with a parse as backend service through my user sign-up and logging in to Facebook Should be able to.
I did it in the following (works perfectly well). {string} = ["user_about_me", "user_relationships", "public_profile"] PFFacebookUtils.logInWithPermissions (permissions, {(user : PFUser !, Error: NSError) -> If the users are not valid, == Zero {NSLog ("Uh oh. User canceled the login Facebook.")} Else if user.isNew {NSLog ("User sign Up and log in through Facebook! ") Self.loadData () self.performSegueWithIdentifier (" initialToMain ", this: self)} else {NSLog (" user in Facebook Log in! ") Self.performSegueWithIdentifier (" initialToMain ", this: self)}}}} loadData (function) {go to request: FBRequest = FBRequest.requestForMe () Request.startWithCompletionHandler {(Connection: FBRequestConnection !, resu Lieutenant : Any object !, Error: NSERR!) - & gt; Error if error == zero {if given = as the result? Dictionary & lt; String, AnyObject & gt; {Name: string = dict ["name"] as AnyObject? Like String Emails Email: String = Dick ["Email"] as AnyObject? . PFUser.currentUser () setValue (email, forKey: "email") .: String println (name) as PFUser.currentUser () setValue ("user name" name, forKey). Save PFUser.currentUser () ()}}}} Unfortunately I was not able to get a profile picture from the user signing up. How can I do this?
The image is available on the public URL via the URL ID: / P>
Https://graph.facebook.com/USER_ID/picture
You can also request different sizes:
Https: // graph. Facebook.com/USER_ID/picture?width=300&hight=300
No comments:
Post a Comment