我正在尝试从我的应用程序在Facebook上发布图片,但发布成功升格后,SharePost屏幕不会自动消失 这是我的代码:
let content:FBSDKSharePhotoContent = FBSDKSharePhotoContent()
content.photos = [self.sharePhoto]
let shareDialog: FBSDKShareDialog = FBSDKShareDialog()
shareDialog.shareContent = content
shareDialog.delegate = self
shareDialog.fromViewController = self
shareDialog.show()
FBSdk SharingDelegate方法:
func sharer(_ sharer: FBSDKSharing!, didCompleteWithResults results:
[AnyHashable : Any]!) {
print(results)
dismiss(animated: true, completion: nil)
}
func sharer(_ sharer: FBSDKSharing!, didFailWithError error: Error!) {
print(error)
}
func sharerDidCancel(_ sharer: FBSDKSharing!) {
print("Cancel")
}