简体   繁体   中英

Facebook SDK share on iOS returns share was cancelled

I'm sharing to Facebook with FB share dialog like this:

                        guard let localIdentifier = localIdentifier else {return}
                    let assetURL = "assets-library://asset/asset.MOV?id=" + localIdentifier + "&ext=MOV"

                    let video : FBSDKShareVideo = FBSDKShareVideo()
                    video.videoURL = URL(string:assetURL)
                    let content : FBSDKShareVideoContent = FBSDKShareVideoContent()
                    content.video = video

                    let shareDialog = FBSDKShareDialog()
                    shareDialog.shareContent = content
                    shareDialog.delegate = self

                    DispatchQueue.main.asyncAfter(deadline: .now() + 1.0  , execute: {
                        shareDialog.show()
                    })

I check that the url is valid. This is a local MOV file and I copy it first to the camera roll. Then I retrieve it using PHManager and trying to share with FBSDK share dialog.

The FB sharing dialog with the movie appears and I press post. The FB seems processes the file and I get a V - that probably the video was shared.Afterwards I get the callback the share was cancelled. Did somebody experience the same? What might be the problem?

Thanks in advance.

What version of the FacebookSDK are you using? I had this problem too and it was because the version that I was using was not compatible with iOS 11 yet. I think that from v 4.27 it's compatible, I was using v4.23. Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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