I have a problem i implement Facebook SDK in my view controller and want to get list of friends and email using Facebook. I wrote this:
FBLoginView *loginView = [[FBLoginView alloc] initWithReadPermissions:@[@"public_profile", @"email", @"user_friends"]];
loginView.delegate = self;
and then use the protocol method of FBLoginViewDelegate:
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<FBGraphUser>)user
{
self.profilePictureView.profileID = user.id;
self.nameLabel.text = user.name;
NSLog(@"%@", user);
NSLog(@"%@", [user objectForKey:@"email"]);
}
In console i got this:
2014-12-04 14:56:48.746 FBLoginUIControlSample[2941:613]
"first_name" = Pavel;
gender = male;
id = 1379600000000000;
"last_name" = name;
link = "https://www.facebook.com/app_scoped_user_id/1379600000000000/";
locale = "ru_RU";
name = "Pavel name";
timezone = 2;
"updated_time" = "2014-12-03T11:47:13+0000";
verified = 1;
2014-12-04 14:56:48.748 FBLoginUIControlSample[2941:613] (null)