I am using FBSDKShareKit to share video and images on facebook.
Here is the code:-
if self.postObject.videoUrl.count > 0 {
let content = ShareMediaContent()
for VideoData in self.postObject.postedMedia {
let video = ShareVideo.init(data: VideoData)
content.media.append(video)
}
for thumb in self.postObject.postedVideoThumb {
let photo = SharePhoto(image: thumb, userGenerated: true)
content.media.append(photo)
}
let dialog = ShareDialog(fromViewController: self, content: content, delegate: self)
print(dialog.canShow)
dialog.show()
}
But I am getting print(dialog.canShow) as false.
And the error I am getting in the "didFailWithError" delegate is:-
" Error Domain=com.facebook.sdk.share Code=2 "(null)" UserInfo={com.facebook.sdk:FBSDKErrorArgumentValueKey={length = 1727854, bytes = 0x00000014 66747970 71742020 00000000 ... acdda1ed 0ae116c8 }, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Cannot share video data., com.facebook.sdk:FBSDKErrorArgumentNameKey=data} "
Where am I doing wrong?
User contributions licensed under CC BY-SA 3.0