My app uses the facebook login to authenticate the users, I heard about the facebook integration become inside the iOS SDK itself,
now if the integration become in
Well, First of all you have to add the Social.framework in to your project.
Step 2 : You need to import two classes.Import the needed classes.
#import
#import
Step 3 : I am going forward in the assumption that you have a button for Facebook in your app. At the button click write these lines. You are done. :-)
- (IBAction)facebookButtonClicked:(id)sender
{
if([SLComposeViewController isAvailableForServiceType: SLServiceTypeFacebook])
{
// Facebook Service Type is Available
SLComposeViewController *slVC = [SLComposeViewController composeViewControllerForServiceType: SLServiceTypeFacebook];
SLComposeViewControllerCompletionHandler handler = ^(SLComposeViewControllerResult result)
{
if (result == SLComposeViewControllerResultCancelled)
{
NSLog(@"Cancelled");
}
else
{
NSLog(@"Done");
}
[slVC dismissViewControllerAnimated:YES completion:Nil];
};
slVC.completionHandler = handler;
[slVC setInitialText:@"Test Post from iOS6"];
[slVC addURL:[NSURL URLWithString:@"http://www.apple.com"]];
[slVC addImage:[UIImage imageNamed:@"someimage.png"]];
[self presentViewController:slVC animated:YES completion:Nil];
}
else
{
NSLog(@"Service Unavailable!!!");
}
}
The above given is the basic steps. For more you can refer This.
Edit : For Facebook user information refer this answer.
Happy Coding. :-)