UIActivityViewController不会在iOS 7上显示FB和Twitter [英] UIActivityViewController doesn't show FB and Twitter on iOS 7

查看:109
本文介绍了UIActivityViewController不会在iOS 7上显示FB和Twitter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用UIActivityViewController共享一些项目。在iOS 6上它工作正常。但是当我在iOS 7上测试时,只显示邮件图标。我怀疑我的SDK太旧了,我下载了最新的SDK,但它的行为仍然相同。我在模拟器和安装了facebook的设备上进行了测试,没有运气。

I am trying to share some items using UIActivityViewController. On iOS 6 it works fine. But when I test it on iOS 7 only mail icon shows up. In doubt that my SDK was too old I downloaded the most recent one, but it's still behaves the same. I tested on both simulator and a device with facebook installed on it, no luck.

现在我的想法已经不多了。

Now I am running out of ideas what I do wrong.

这是我的代码

- (void)shareButtonWasTapped:(BMPopUpMenuView *)popUpMenu {

NSString *shareText;

if (_correctPatternFound) {
    shareText = @"Yey, I solved a puzzle!";
}
else {
    shareText = @"I am solving a photzle...";
}

NSURL *shareURL = [NSURL URLWithString:@"http://somewebsite.com"];

NSArray *items   = [NSArray arrayWithObjects:
                    shareText,
                    _shareImage,
                    shareURL, nil];


UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
[activityViewController setValue:shareText forKey:@"subject"];

activityViewController.excludedActivityTypes =   @[UIActivityTypeCopyToPasteboard,
                                                   UIActivityTypePostToWeibo,
                                                   UIActivityTypeSaveToCameraRoll,
                                                   UIActivityTypeCopyToPasteboard,
                                                   UIActivityTypeMessage,
                                                   UIActivityTypeAssignToContact,
                                                   UIActivityTypePrint];

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


推荐答案

他们不会在什么时候显示您没有在设置中设置Twitter和Facebook帐户。 Facebook或Twitter应用程序是不够的 - 您应该明确设置帐户。

也许这不是很酷,(用户可能希望在fb或twitter上分享一些内容并为其执行登录)但Apple认为这些活动应该在iOS 7中有效。

They won't show when you don't have Twitter and Facebook accounts set up in settings. Facebook or twitter app are not enough - you should have explicitly set accounts.
Maybe it's not really cool, (user may want to share something on fb or twitter and perform login for it) but Apple considered these activities should work so in iOS 7.

这篇关于UIActivityViewController不会在iOS 7上显示FB和Twitter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆