iPhone facebook 连接电子邮件返回 null

发布于 2024-09-16 01:01:28 字数 1328 浏览 9 评论 0原文

我正在使用适用于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗忘曾经 2024-09-23 01:01:28

您可能需要请求扩展“邮件”权限。请参阅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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文