作者:784485886_fe0643 | 来源:互联网 | 2023-01-13 15:21
1> Jaydeep Vyas..:
您可以使用facebook sdk共享内容
步骤1:
安装吊舱:- pod 'FacebookShare'
第2步:
导入FBSDKShareKit
第三步:
func shareTextOnFaceBook() {
let shareCOntent= ShareLinkContent()
shareContent.cOntentURL= URL.init(string: "https://developers.facebook.com")! //your link
shareContent.quote = "Text to be shared"
ShareDialog(fromViewController: self, content: shareContent, delegate: self).show()
}
func sharer(_ sharer: Sharing, didCompleteWithResults results: [String : Any]) {
if sharer.shareContent.pageID != nil {
print("Share: Success")
}
}
func sharer(_ sharer: Sharing, didFailWithError error: Error) {
print("Share: Fail")
}
func sharerDidCancel(_ sharer: Sharing) {
print("Share: Cancel")
}
步骤4:必须在其中添加 Info.plist
LSApplicationQueriesSchemes
fbauth2