BEST WAY TO FIND A USERNAME FROM A FACEBOOK ID

Takeshi Okada

Total Post:89

Points:629
Posted by  Takeshi Okada
 1562  View(s)
Ratings:
Rate this:
Hi All!

I have a Facebook user's id. How do I get their username?

Specifically, I am using a FBFriendPickerController

for (id<FBGraphUser> user in self.friendPickerController.selection) {
   NSLog(@"The Facebook User: %@", user);
}
^This outputs stuff like the name, id, first name, last name, profile photo, but it does not give the user's username.

So, in regards to FBFriendPickerController, what is the best way to get the username of a selected user?

Your help is great appreciated. 

  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: Best Way To Find a Username From a Facebook ID

    Hi Takeshi!


    Try as following

    You can find the username by looking at the JSON returned by graph.facebook.com/(fb_id)
    But is there a better way of doing this, straight from the friendPickerController, that is the question.

    I hope it helpful to you.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!