0

我想与分享YouTube视频。FacebookUIActivityViewController

所以我创建UIActivityViewController

UIActivityViewController *activityViewController = [[UIActivityViewController alloc] 
initWithActivityItems:activityItems applicationActivities:applicationActivities];

YouTubeAppDelegate *md = (YouTubeAppDelegate*)[[UIApplication sharedApplication] delegate];
[self presentViewController:activityViewController animated:YES completion:^{}];

我将 YouTube 链接添加到此。

但是当我按下Facebook按钮时UIActivityViewController,它会将其作为文本发布在Facebook而不是嵌入视频播放器中。知道我该如何解决吗?

4

1 回答 1

3
NSArray * activityItems = @[[NSString stringWithFormat:@"Some initial text."], [NSURL URLWithString:@"http://www.youtube.com/watch?v=yyEWkJgdftE"]];
    NSArray * applicationActivities = nil;
    NSArray * excludeActivities = @[UIActivityTypeAssignToContact, UIActivityTypeCopyToPasteboard, UIActivityTypePostToWeibo, UIActivityTypePrint, UIActivityTypeMessage];

    UIActivityViewController * activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];
    activityController.excludedActivityTypes = excludeActivities;

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

在此处输入图像描述

于 2013-08-22T14:14:46.723 回答