Unable to transfer Facebook video to Swift

I am trying to share a video on facebook using FBShareDialog.

But I get an error message:

The operation could not be completed. (error com.facebook.sdk.share 2.)

I have a file path:

File: ///var/mobile/Containers/Data/Application/8FA91DC3-D039-40DE-81BD-D70936343AD2/Documents/Erudition.mp4

And the code to share:

let fbShare = FBSDKShareDialog.init() let videoContent = FBSDKShareVideoContent() let shareVideo = FBSDKShareVideo.init(videoURL: path) videoContent.video = shareVideo fbShare.shareContent = videoContent fbShare.delegate = self fbShare.show() 

What is wrong here?

+5
source share

Source: https://habr.com/ru/post/1262236/


All Articles