Вы можете сделать это, используя запрос без трения, как показано ниже
NSString *to =[NSString stringWithFormat:@"%d",[[[FriendUIDArray
objectAtIndex:index]
objectForKey:@"uid"] intValue]];
FBFrictionlessRecipientCache *friendCache =
[[FBFrictionlessRecipientCache alloc] init]; [friendCache
prefetchAndCacheForSession:nil];
NSMutableDictionary* params = [NSMutableDictionary
dictionaryWithObjectsAndKeys:
to, @"to",
nil];
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:[NSString stringWithFormat:@"I’m using Nightup to find great party's
around me."] title:nil parameters:params handler:^(FBWebDialogResult result,
NSURL *resultURL, NSError *error)
{
if (error) {
// Case A: Error launching the dialog or sending request.
NSLog(@"Error sending request.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// Case B: User clicked the "x" icon
NSLog(@"User canceled request.");
} else {
NSLog(@"Request Sent.");
}
}}
friendCache:friendCache];
Если у вас нет Uid определенного друга, которого вы хотите пригласить, следуйте этому методу, который позволит вам выбрать друга в диалоге.
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:nil];
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:[NSString stringWithFormat:@"I just smashed %d friends! Can you beat it?", nScore]
title:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Case A: Error launching the dialog or sending request.
NSLog(@"Error sending request.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// Case B: User clicked the "x" icon
NSLog(@"User canceled request.");
} else {
NSLog(@"Request Sent.");
}
}}];
Вы можете найти более подробную информацию здесь