2016-11-24 82 views
0

我在facebook上分享預定義文本。我只需要分享文字而不是圖片或網址。但是得到這個錯誤。分享facebook上的內容

enter image description here

let content = FBSDKShareLinkContent() 

content.quote = "test" 

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

if !shareDialog.canShow() { 
    print("cannot show native share dialog") 
} 

shareDialog.show() 

回答

2

這是由於平臺的限制政策Facebook的SDK的。你可以在這裏得到更多的信息(Sharing on iOS - Facebook),但在幾句話 - 你不能分享通過Facebook分享的Widget預定義的文本:

使用iOS份額片的受Facebook平臺政策,其中包括規定第2.3節該應用程序可能不會預先填充分享表的內容。這意味着應用程序可能不會預先填充分享表的initialText字段,而其中的內容未由應用程序的用戶輸入。

+0

預填充文本正在工作,但如果我設置了url或圖像。 –

+1

如果您嘗試共享純文本,但它不會共享其他內容,例如網址,圖片,視頻等,則該功能無效。 – dive

+0

如果它以某種方式工作,則不允許預填充。 – luschn