我与 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/