You can easily send an application request very easily using the Facebook SDK
To apply for the application Make sure the following steps
1) Make sure you add the latest Facebook file to your application folder
If not, you can download from this link.
Now you just need to add the FBConnect folder to the project folder.
2) Then, make sure you register your iphone application as a “Facebook application”. your application integrates with Facebook in the "Basic Application Settings" section.
If not, you can do it here .
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];
Please remember to accept the FBdialogDelegate protocol first in the ViewController class.
source share