简体   繁体   English

在Facebook iOS SDK 4.4上共享视频

[英]Sharing Video on Facebook iOS SDK 4.4

In my iOS mobile app, i need to share/upload a video(from Server not a local Video) on Facebook account. 在我的iOS移动应用中,我需要在Facebook帐户上共享/上传视频(从服务器而不是本地视频)。 I am using iOS 8.0 & FacebookSDK 4.4. 我正在使用iOS 8.0和FacebookSDK 4.4。 I have tried lots of code, but any of them not working. 我尝试了很多代码,但是其中任何一个都不起作用。

This is the code what am trying 这是代码正在尝试

        FBSDKShareVideo *video = [[FBSDKShareVideo alloc] init];
        video.videoURL = myServerVideoUrl;
        FBSDKShareVideoContent *content = [[FBSDKShareVideoContent alloc] init];
        content.video = video;
        [FBSDKShareDialog showFromViewController:_controller
                                     withContent:content
                                        delegate:self];

but facebook throwing an error like 'Only asset file URLs are allowed for the native dialog" 但是facebook抛出错误,例如“本机对话框仅允许使用资产文件网址”

what am missing..Please help me..Thanks 缺少什么..请帮助我..谢谢

Please note that, i need to sent video that are saved n Server.i have videoURl 请注意,我需要发送在Server.i中保存的视频。我拥有videoURl

Thanks 谢谢

As stated by @hpp in the comment, the video be an asset URL : 如@hpp在评论中所述,视频应为资产网址

The video URL videoURL must be an asset URL. 视频URL videoURL必须是资产URL。 You can get a video asset URL eg from UIImagePickerController. 您可以从UIImagePickerController获得视频资产URL。

If you want to upload a video using an external URL, try video upload using the Graph API. 如果要使用外部URL上传视频,请尝试使用Graph API上传视频 You can upload a video using the edge /{user_id}/videos with the file_url parameter. 您可以使用/{user_id}/videos file_url参数的边缘/{user_id}/videos上传视频。 Read more here . 在这里阅读更多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM