0

I am new in IOS development? In my project I want to invite Facebook friend.when Facebook app is installed and not installed in both cases i want to invite my friend? how can be done

//Below is my code

NSMutableDictionary* params =   [NSMutableDictionary dictionaryWithObjectsAndKeys:nil];

    [FBWebDialogs presentRequestsDialogModallyWithSession:nil
                                              message:[NSString stringWithFormat:@"I just smashed  friends! Can you beat it?"]
                                                title:@"StopNSwap"
                                           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:nil];
rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

As far as I understand you are trying to send an app-to-user request to invite user's Facebook friends to start using your application, correct? Checkout the first answer here, Paul suggests an effective way of doing it using the Facebook SDK : How to send add friend request (to facebook user) from iOS application?

Community
  • 1
  • 1