Pregunta

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

¿Fue útil?

Solución

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];
}

Otros consejos

In UIActivityViewController, there is no such feature. One thing to remind you, Your fear is correct. But there is no need to fear about this. Because If your build installed in device, even if it will be update with new version of IOS, it won't update app's feature that already exists. That's before going to update your app with new version of xcode(assume new xcode has feature which you fear about), your app won't show more than this. Else if you want to give update with new xcode, You must handle this situation in new version.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top