共享UIActivityViewController中缺少的服务

时间:2014-01-27 13:26:16

标签: ios uiactivityviewcontroller

我正在使用UIActivityViewController在我的项目中进行共享和邮寄。

但仅显示邮件服务和邮件服务,但不显示Facebook,Twitter和其他服务。

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

//显示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

是否依赖于iphone设置? 我已启用权限,我尝试了但结果是一样的....

1 个答案:

答案 0 :(得分:0)

您必须在设备设置中添加帐户

<强> Setting > Facebook
Setting > Twitter

设置它然后尝试,

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

如果您共享图像,则会显示相关活动。