ios - 如何获取 Facebook 用户的已验证状态

标签 ios xcode facebook-graph-api ios6 xcode4.6

我与 HelloFacebookSample 一起使用 iOS 版 Facebook SDK 从用户帐户中检索已验证 状态。

我试图在下面的方法中从 user 实例中检索。但它似乎没有定义
那里。

如何检索已验证状态?

- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
                            user:(id<FBGraphUser>)user {
    // here we use helper properties of FBGraphUser to dot-through to first_name and
    // id properties of the json response from the server; alternatively we could use
    // NSDictionary methods such as objectForKey to get values from the my json object
    self.labelFirstName.text = [NSString stringWithFormat:@"Hello %@!", user.first_name];
    // setting the profileID property of the FBProfilePictureView instance
    // causes the control to fetch and display the profile picture for the user
    self.profilePic.profileID = user.id;
    self.loggedInUser = user;
}

最佳答案

我得到了答案:

- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
                            user:(id<FBGraphUser>)user {
    // here we use helper properties of FBGraphUser to dot-through to first_name and
    // id properties of the json response from the server; alternatively we could use
    // NSDictionary methods such as objectForKey to get values from the my json object
    self.labelFirstName.text = [NSString stringWithFormat:@"Hello %@!", user.first_name];
    // setting the profileID property of the FBProfilePictureView instance
    // causes the control to fetch and display the profile picture for the user
    self.profilePic.profileID = user.id;
    self.loggedInUser = user;

    NSLog(@"userInfo %@",[user objectForKey:@"verified"]);

}

关于ios - 如何获取 Facebook 用户的已验证状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15582426/

相关文章:

ios - SCNBillboardConstraint 不工作。有约束的节点不会改变

ios - 'NSRangeException',原因 : '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'

xcode构建错误框架未找到

java - 从 java 写到 facebook friend 的墙上

javascript - Graph API 将 base64 IMAGE 发布到 Facebook

iphone - Facebook API SDK 3.0 "An error occurred with app"

ios - 我如何在 ARkit 场景 iOS 中添加具有文本的 2dView

iphone - iOS:保持应用程序在后台运行

ios - 如何获取本地保存的UIImage到UIImage的路径?

ios - Xcode 14 Assets 验证失败 - 缺少应用程序图标