当我这样做时:
- (void) viewDidLoad {
[_fbLoginView setReadPermissions[@"public_profile", @"email"]];
[_fbLoginView setDelegate:self];
}
- (void)loginViewFetchedUserInfoFBLoginView *)loginView
userid<FBGraphUser>)user {
self.profilePictureView.profileID = user.id;
self.nameLabel.text = user.name;
}
我刚刚得到:
(lldb) po user
{
"first_name" = Name;
gender = female;
id = 1459547723244130;
"last_name" = Surname;
link = "https://www.facebook.com/app_scoped_user_id/1459547723244130/";
locale = "en_US";
name = "Name Surname";
timezone = 1;
"updated_time" = "2014-06-30T08:07:59+0000";
verified = 1;
}
即使我被告知申请需要我的电子邮件地址。
如何使用 FBLoginView 从 Facebook 获取用户电子邮件?
Best Answer-推荐答案 strong>
检查权限点击Here
viewController.h
@interface ViewController : UIViewController<FBLoginViewDelegate>
viewController.m
- (void)viewDidLoad {
[super viewDidLoad];
FBLoginView *loginView = [[FBLoginView alloc] init];
loginView.center = self.view.center;
loginView.readPermissions = @[@"public_profile", @"email", @"user_friends"];
[loginView setDelegate:self];
[self.view addSubview:loginView];
// Do any additional setup after loading the view, typically from a nib.
}
登录成功后调用波纹管委托(delegate)方法
- (void)loginViewFetchedUserInfoFBLoginView *)loginView
userid<FBGraphUser>)user {
self.profilePictureView.profileID = user.id;
self.nameLabel.text = user.name;
}
关于ios - FBLoginView 未收到用户电子邮件,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/24880322/
|