【发布时间】:2015-10-14 10:29:24
【问题描述】:
我想使用 sdk 在 Facebook 墙上分享图片和视频。
我使用以下代码分享图片
FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = [UIImage imageNamed:@"Classic-Guitar.jpg"];
photo.userGenerated = YES;
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
content.photos = @[照片];
FBSDKShareDialog *shareCodeDialog;
shareCodeDialog = [FBSDKShareDialog new];
[shareCodeDialog setDelegate:self];
[shareCodeDialog setShareContent:content];
[shareCodeDialog setFromViewController:self];
[shareCodeDialog show];
使用此代码我可以在墙上发布图像,但在发送视频时我使用以下代码
NSURL *videoURL = [[NSURL URLWithString:@"https://www.youtube.com/watch?v=rSAiSTkVMfs"] absoluteURL];
FBSDKShareVideo *video = [[FBSDKShareVideo alloc] init];
video.videoURL = videoURL;
FBSDKShareVideoContent *content = [[FBSDKShareVideoContent alloc] init];
content.video = video;
FBSDKShareDialog *shareCodeDialog;
shareCodeDialog = [FBSDKShareDialog new];
[shareCodeDialog setDelegate:self];
[shareCodeDialog setShareContent:content];
[shareCodeDialog setFromViewController:self];
[shareCodeDialog show];
但它没有被张贴给和错误的代表说 错误 Domain=com.facebook.sdk.share Code=2 “操作无法完成。(com.facebook.sdk.share 错误 2。)” UserInfo=0x16d95990 {com.facebook.sdk:FBSDKErrorArgumentValueKey=https://www.youtube.com/watch?v=rSAiSTkVMfs , com.facebook.sdk:FBSDKErrorArgumentNameKey=videoURL, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=videoURL 的值无效:https://www.youtube.com/watch?v=rSAiSTkVMfs}
【问题讨论】: