2
當我這樣做:FBLoginView沒有得到用戶的電子郵件
- (void) viewDidLoad {
[_fbLoginView setReadPermissions:@[@"public_profile", @"email"]];
[_fbLoginView setDelegate:self];
}
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<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獲取用戶電子郵件?
Graph Explorer是否顯示您的電子郵件地址:https://developers.facebook.com/tools/explorer?method=GET&path=me%3Ffields%3Did%2Cname%2Cemail&version=v2.0如果不是,請看一看在你的Facebook個人資料,並檢查電子郵件地址是否結束'@ facebook.com' – Tobi
問題是圖形API不顯示我的電子郵件地址!問題是我的FB測試帳戶沒有確認電子郵件地址,所以沒有發送。 – squixy
那麼,當您的測試帳戶沒有確認的電子郵件,那麼這是行不通的。正如文檔中所述:'如果沒有有效的電子郵件地址可用,則不會返回此字段 – Tobi