如何在Swift中在Facebook上分享视频?

问题描述

我尝试将视频分享到Facebook,但是当对话框显示的视频没有出现时。

func facebookShare(url: URL){
        guard let schemaUrl = URL(string: "fb://") else {
                    return //be safe
        }
        if UIApplication.shared.canOpenURL(schemaUrl) {

        let video = ShareVideo(videoURL: url)
        let content = ShareVideoContent()
        content.video = video
        let dialog = ShareDialog()
        dialog.shareContent = content
        dialog.delegate = self
        dialog.fromViewController = self
        dialog.mode = .automatic
        dialog.show()
            
        
        }else {
            print("app not installed")
        }

    }

这是我的图像选择器功能

func imagePickerController(_ picker: UIImagePickerController,didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
        self.dismiss(animated: true,completion: nil)
        videoURL = info[UIImagePickerController.InfoKey.init(rawValue: "UIImagePickerControllerMediaURL")] as? URL
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)