0

I want to integrate Facebook in my app. The functionality like this the user will login in to Facebook, then fetch the all friends & send the friend request for the app. I uses IOS6.

So, is there any solution for this using Social framework?

How can i do this?

I get code from Here

But getting error for account.

Community
  • 1
  • 1
user2357044
  • 57
  • 1
  • 6

2 Answers2

2

This:Facebook SDK for iOS and the iOS 6 Facebook Integration

and this:How to easily integrate your iOS App with Facebook

UPDATE: App Request

You can easily send the app request very easily by Using Facebook SDK For Making App Request Please Make sure Following steps

1)Make sure you have added the latest Facebook SDK in Your Application Folder

if not,you may download from this link https://github.com/facebook/facebook-ios-sdk

Now you just need to Add FBConnect Folder in your Project Folder.

2)Then Make sure you have Registered your iphone App as "App on Facebook" Type Select how your app integrates with Facebook under Basic App Settings.

if not,you can do that here https://developers.facebook.com/apps/

NSString *friendId=@"FacebookId Of Your Friends";

NSLog(@"%@",friendId);

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"Hi please add me as a friend.",  @"message",
                                   friendId, @"to",
                                   nil];
 [appDelegate.facebook dialog:@"apprequests" andParams:params  andDelegate:self];

Also, don't forget to adopt the FBdialogDelegate protocol first in your ViewController Class.

UPDATE2: Friend Request

Create a NSMutableDictionary to make a "appRequest" with their corresponding parameters but indicate that the type of dialogue is a "friends". It's a strange solution but it works.

Facebook *face = [[Facebook alloc] initWithAppId:FBSession.activeSession.appID andDelegate:nil];
face.accessToken = FBSession.activeSession.accessToken;
face.expirationDate = FBSession.activeSession.expirationDate;
if ([face isSessionValid]){
    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   @"My Title", @"title",
                                   @"Come check out my app.",  @"message",
                                   userId, @"id",
                                   nil];
    [face dialog:@"friends"
       andParams:[params mutableCopy]
     andDelegate:nil];
}

Hope this helps you out. If so, please feel free to accept the answer.

NMALKO
  • 168
  • 1
  • 7
2

You can check this over here :

send-requests-using-ios-sdk

and
invites and requests

Hope it helps you.

Nishant Tyagi
  • 9,893
  • 3
  • 40
  • 61