Pregunta

I'm using UIActivityViewController for sharing and mailing in my project.

But only mailing service and message service is shown but not facebook, twitter and other services.

NSArray *activityItems = [NSArray arrayWithObjects: shareUrl, nil];

//code for displaying UIActivityviewController

NSURL *shareUrl = [NSURL URLWithString:@"http://www.captechconsulting.com"];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
activityViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;


[self presentViewController:activityViewController animated:YES completion:nil];

os: ios7

Does it depend on iphone settings? I have enabled permissions and i tried it but the result is same....

¿Fue útil?

Solución

You have to add account in your device setting,

Setting > Facebook
Setting > Twitter

Set it and than try,

NSURL *shareUrl = [NSURL URLWithString:@"http://www.captechconsulting.com"];
NSArray *activityItems = [NSArray arrayWithObjects: shareUrl, nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
activityViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

[self presentViewController:activityViewController animated:YES completion:nil];

If you share image also than related activity will display.

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