views:

70

answers:

1

Hi,

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

A: 

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

thepumpkin1979