Home > DeveloperSection > Forums > Best Way To Find a Username From a Facebook ID
Takeshi Okada
Takeshi Okada

Total Post:89

Posted on    May-20-2013 1:12 AM

 Facebook API Facebook API 

 1 Reply(s)
 1497  View(s)
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. 


Total Post:604

Posted on    May-20-2013 8:51 AM

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.

Don't want to miss updates? Please click the below button!

Follow MindStick