UIActivityViewController include rather than exclude Activity Types
ios, iphone, share, uiactivityviewcontroller
Solution
If you are using `SLComposeViewController` user only post a message to facebook. Before using `SLComposeViewController` you need to add Social FrameWork.
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
{
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[controller setInitialText:@"Using Facebook to share your Images"];
[controller addImage:PresentImg];
[self presentViewController:controller animated:YES completion:Nil];
}
Problem
I am using UIActivityViewController. For a particular share message, I only want to offer users the UIActivityTypePostToFacebook (i.e. only share via facebook). I realise I can use the excludedActivityTypes method to exclude all the other current Activity Types. However, my fear with this approach is that in the future more Activity Types might appear and so my app will automatically add those in for future OS versions. Therefore, I was wondering is there a way to state only the Activity Types you want to have appear (i.e. an includedActivityTypes version of the excludedActivityTypes method) Cheers, Charlie