Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TiernanKennedy/6246273 to your computer and use it in GitHub Desktop.
Save TiernanKennedy/6246273 to your computer and use it in GitHub Desktop.
Invite Array of friends to Facebook Dialog
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
if([invitations count] != 0){
NSString * stringOfFriends = [invitations componentsJoinedByString:@","];
[params setObject:stringOfFriends forKey:@"to"];
NSLog(@"%@", params);
}
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:[NSString stringWithFormat:@"Come join me on iFlipd!"]
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. resultURL %@", resultURL);
}
}}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment