无法打开Facebook Messenger以从iOS App共享视频

时间:2015-09-15 06:59:54

标签: ios objective-c facebook facebook-messenger

我想使用以下代码在Facebook Messenger中分享我的iOS应用程序中的视频:

NSURL *videoURL = [NSURL fileURLWithPath:[self.myViewController getSharingVideoPath]];
FBSDKShareVideo *video = [[FBSDKShareVideo alloc] init];
video.videoURL = videoURL;
FBSDKShareVideoContent *content = [[FBSDKShareVideoContent alloc] init];
content.video = video;
[FBSDKShareDialog showFromViewController:self withContent:content delegate:nil];

这是videoURL的输出:

file:///private/var/mobile/Containers/Data/Application/13D19738-5F9E-4C77-A502-0E18F5D09A10/Documents/anonymous/MyApp/144229926301/MyVideo.mov

当我跑步时,没有错误,但Facebook Messenger不会打开。

我从

复制了代码
https://developers.facebook.com/docs/sharing/ios 

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
  NSURL *videoURL = [info objectForKey:UIImagePickerControllerReferenceURL];

  FBSDKShareVideo *video = [[FBSDKShareVideo alloc] init];
  video.videoURL = videoURL;
  FBSDKShareVideoContent *content = [[FBSDKShareVideoContent alloc] init];
  content.video = video;
}

0 个答案:

没有答案