For iOS 11 this line:
([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
is always returning NO
I replaced it with check if user has Facebook app installed with:
static NSString *const canOpenFacebookURL = @"fbauth2";
+ adding it to LSApplicationQueriesSchemes
in plist
-(BOOL)isFacebookAppInstalled {
NSURLComponents *components = [[NSURLComponents alloc] init];
components.scheme = canOpenFacebookURL;
components.path = @"/";
return [[UIApplication sharedApplication]
canOpenURL:components.URL];
}
And then just call SLComposeViewController *composeVC = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
as usual, the same how Matheus Domingos described. But with this check at least you know that user has facebook app installed.