使用Facebook SDK共享视频



我正在尝试使用Facebook-SDKiOS中共享YouTube视频,但它总是返回error code 2

视频的无效价值

这是我的代码

NSURL *videoURL =[NSURL URLWithString: @"https://youtu.be/i-QlMqZh8_g"];
FBSDKShareVideoContent *content =[[FBSDKShareVideoContent alloc]init];
content.video= [FBSDKShareVideo videoWithVideoURL:videoURL];
[FBSDKShareAPI shareWithContent:content delegate:self];

共享youtube链接:

NSURL *videoURL =[NSURL URLWithString: @"https://youtu.be/i-QlMqZh8_g"];
FBSDKShareLinkContent *shareLinkContent = [[FBSDKShareLinkContent alloc] init];
shareLinkContent.contentURL = videoURL;
[FBSDKShareAPI shareWithContent:shareLinkContent delegate:self];

最新更新