I'm using the code snippet which was posted on my previous question, Simple way to add Facebook/Twitter share to app?
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *slComposeViewController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[slComposeViewController setInitialText:@"Your text"];
[slComposeViewController addImage:[UIImage imageNamed:@"NameOfImage"]];
[self presentViewController:slComposeViewController animated:YES completion:nil];
} else {
//Show alert or in some way handle the fact that the device does not support this //feature
NSLog(@"Facebook not available");
}
But when I run it on the device and in the simulator all I'm getting is "Facebook not available", what could I be doing wrong?
I've looked at the available tutorials, and I've included the libraries that are required, so I'm not sure what else I'm doing wrong.