2016-07-06 18 views
0

是否有一個參數可以在Facebook共享對話框中更改粗體黑色文本(下面示例中的文本爲「Google」)?如果是,哪一個?在Facebook的共享對話框中更改粗體黑色標題

example screenshot

我的代碼:

window.fbAsyncInit = function() { 
 
    var locationArray = window.location.href.split("/"); 
 

 
    FB.init({ 
 
    channelUrl: locationArray[0] + '//' + locationArray[2] +  '/channel.php', //custom channel 
 
    xfbml  : true, 
 
    version : 'v2.6' 
 
    }); 
 

 

 

 
} 
 
function test(){ 
 
    alert("test"); 
 
    FB.ui(
 
    { 
 
     method: 'share', 
 
     name: 'Sharing Test Name', 
 
     caption: 'Sharing Test Caption', 
 
     //picture: 'http://4.bp.blogspot.com/-8BR3- K0b_lI/VlZ6b3WCM5I/AAAAAAAARmA/ATbes06U8oU/s1600/mustache-smiley.jpg', 
 
     description: "Post to test the sharing funtion available via Facebook's js sdk", 
 
     href: 'https://google.de', 
 
    }, 
 
    // callback 
 
    function(response) { 
 
     if (response && !response.error_message) { 
 
     alert('Posting completed.'); 
 
     } else { 
 
     alert('Error while posting.'); 
 
     } 
 
    } 
 
); 
 
}
<script>(function(d, s, id) { 
 
    var js, fjs = d.getElementsByTagName(s)[0]; 
 
    if (d.getElementById(id)) return; 
 
    js = d.createElement(s); js.id = id; 
 
    js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&appId={{ fbAppId }}&version=v2.5"; 
 
    fjs.parentNode.insertBefore(js, fjs); 
 
}(document, 'script', 'facebook-jssdk'));</script> 
 

 
<div onclick="test()">share</div>

研究並沒有爲我返回任何東西(Facebook的文檔,在這裏,谷歌)。 Facebook不允許更改對話文本的那部分內容?

+1

更改頁面上的og:title標記 – WizKid

回答

1

曾經有參數來控制這一點,我可能會誤解,但目前我認爲唯一的方法是使用Open Graph元標記。

+0

共享對話框只接受共享的URL,但Feed對話框仍然接受這些[附加參數](https://developers.facebook.com/docs/sharing/reference/feed-dialog#params),注意上面提到的注意事項,你不能爲某些類型的頁面(iTunes,Google Play,Facebook個人資料或頁面)覆蓋它們。雖然這可能會改變未來也有一些問題。 – CBroe

相關問題