开发者

iPhone facebook connect emails returning null

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开发者_JAVA百科 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


May be you need to request an extended 'mail' permission. See http://developers.facebook.com/docs/authentication/permissions

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜