簡體   English   中英

Facebook 圖像共享不起作用

[英]Facebook image share is not working

我試圖從我的網站上分享一個帶有圖片的帖子,但只有圖片沒有被共享,我檢查了查看源上的 og:image 它出現在視圖源上,但它沒有出現在共享框和共享帖子上。

我也試過 facebook 調試,但沒有運氣

頁面鏈接: http : //www.anothercrush.com/polling-detail/second-post

腳步:

  1. 填寫3個字段並提交

  2. 現在您可以看到圖片上方的 facebookshare 按鈕,只需單擊它

  3. 現在您將在共享框上顯示問題(空白框而不是圖像)。

請找出解決辦法

   This code works for me you can try
    <meta property="og:url" content="http://domain.com"/>  
    <meta property="og:title" content="PageTitle"/>
    <meta property="og:description" content=" Description"/>
    <meta property="og:image" content="image path"/>
    <meta property="og:site_name" content="title" />
    <meta property="fb:app_id" content="correct facebook app id"/>

Facebook 控制台這對於檢查您的鏈接 Facebook 控制台很有用

我在頁面視圖源代碼中檢查了你的元標記,但我沒有找到 og:image 屬性,如果你只傳遞這個不傳遞其他參數,它將在頁面中搜索首先找到的內容,就像您的圖像現在工作一樣。

在您點擊時共享和調用此方法 shareOnFacebookUser() 的另一種方法

    var appId='FACEBOOK_ID';
       window.fbAsyncInit = function () {
            // init the FB JS SDK
            FB.init({
                appId: appId, // App ID from the app dashboard      
                status: true, // Check Facebook Login status
                xfbml: true   // Look for social plugins on the page
            });       
        };

        // Load the SDK asynchronously
        (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 = "https://connect.facebook.net/en_US/all.js";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));

          function shareOnFacebookUser() {
            var img = $("#image").val();
            var link = $("#link").val();
            var title = $("#name").val();
            var desc = $("#desc").val();
            FB.ui({
                method: 'feed',
                link: link,
                name: title,
                picture: img,
                description:desc

            }, function (response) {
                if (response && response.post_id) {
                }
                else {
                }
            });
        }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM