谁能帮我。我无法弄清楚如何使用适用于 iOS 的最新 Facebook SDK(v 3.1)进行单个 FQL 查询,以获取用户朋友的生日和电子邮件。当我查询名称等字段时,我得到正确的值,但电子邮件和生日字段为空。
这是我的代码
- (void)facebookViewControllerDoneWasPressed:(id)sender {
// we pick up the users from the selection, and create a string that we use to update the text view
// at the bottom of the display; note that self.selection is a property inherited from our base class
for (id<FBGraphUser> user in _friendPickerController.selection) {
_nameTxt.text = user.name;
NSString *fql = [NSString stringWithFormat:@"SELECT email, birthday, name FROM user WHERE uid = %@ ",user.id];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:fql forKey:@"q"];
[FBRequestConnection startWithGraphPath:@"/fql"
parameters:params
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
NSLog(@"Error: %@", [error localizedDescription]);
} else {
NSLog(@"Result: %@", result);
}
}];
}
[self.navigationController dismissModalViewControllerAnimated:YES];
}
我得到了姓名的价值,但电子邮件和生日为空。
谢谢