我正在尝试使用 UIActivityViewController 共享一些项目。在 iOS 6 上它运行良好。但是当我在 iOS 7 上测试它时,只显示邮件图标。怀疑我的 SDK 太旧了,我下载了最新的 SDK,但它的行为仍然相同。我在模拟器和安装了 facebook 的设备上进行了测试,没有运气。
现在我已经没有想法了,我做错了什么。
这是我的代码
- (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];
}