iPhone facebook 连接电子邮件返回 null
我正在使用适用于 iPhone 的最新 最新 Facebook connect API。我正在尝试从我的应用程序用户的朋友那里获取电子邮件地址。我只考虑用户的那些朋友,他们是相应 Facebook 应用程序的用户,并且已授予 Facebook 应用程序使用其电子邮件地址的权限。我正在执行多重查询来获取用户朋友的 uid,然后获取朋友的信息。请求响应中的其他一切都很好,但电子邮件地址全部返回“null”。这是我的代码:
-(void)viewDidLoad{
[super viewDidLoad];
// create facebook session
NSArray *permissions = [[NSMutableArray alloc] initWithObjects:@"email", nil];
facebook = [[Facebook alloc] init];
[facebook authorize:FB_AUTH_KEY permissions:permissions delegate:self];
[permissions release];
}
-(void)requestFriendsArray{
// create the multiquery
NSString* friendIDs = @"select uid2 from friend where uid1 == me()";
NSString* namesAndPics = [NSString stringWithFormat:@"select pic_square, first_name, last_name, email, is_app_user from user where uid in (select uid2 from #friendIDs)"];
NSString* queries = [NSString stringWithFormat:@"{\"friendIDs\":\"%@\",\"namesAndPics\":\"%@\"}", friendIDs, namesAndPics];
NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithObjectsAndKeys:queries, @"queries", nil];
// send it out
[facebook requestWithMethodName:@"fql.multiquery" andParams:params andHttpMethod:@"GET" andDelegate:self];
[params release];
}
有人知道发生了什么事吗?
谢谢!
-马特
I am using the newest newest Facebook connect API for the iPhone. I am trying to get the email addresses from friends of the my app's user. I am only considering those friends of the user that are users of the corresponding Facebook app, and that have given permission to the Facebook app to use their email address. I am performing a multiquery to get the user's friends' uids and then get the information of the friends. Everything else comes in fine in the response of the request, but the email adresses all return "null". Here is my code:
-(void)viewDidLoad{
[super viewDidLoad];
// create facebook session
NSArray *permissions = [[NSMutableArray alloc] initWithObjects:@"email", nil];
facebook = [[Facebook alloc] init];
[facebook authorize:FB_AUTH_KEY permissions:permissions delegate:self];
[permissions release];
}
-(void)requestFriendsArray{
// create the multiquery
NSString* friendIDs = @"select uid2 from friend where uid1 == me()";
NSString* namesAndPics = [NSString stringWithFormat:@"select pic_square, first_name, last_name, email, is_app_user from user where uid in (select uid2 from #friendIDs)"];
NSString* queries = [NSString stringWithFormat:@"{\"friendIDs\":\"%@\",\"namesAndPics\":\"%@\"}", friendIDs, namesAndPics];
NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithObjectsAndKeys:queries, @"queries", nil];
// send it out
[facebook requestWithMethodName:@"fql.multiquery" andParams:params andHttpMethod:@"GET" andDelegate:self];
[params release];
}
Does anybody have any idea what's going on?
Thanks!
-Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要请求扩展“邮件”权限。请参阅http://developers.facebook.com/docs/authentication/permissions
May be you need to request an extended 'mail' permission. See http://developers.facebook.com/docs/authentication/permissions