1

在过去的一年中,我在 4 个网站上安装了 Facebook Like/Send 按钮(使用异步 javascript),但我注意到 Send 按钮不再有效(尽管在安装测试时它确实有效)。

例如#1:http ://www.libbiking.com/

在相关页面上,我添加了:

<meta property="og:title" content="Libbi King" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.libbiking.com/" />
<meta property="og:image" content="http://www.libbiking.com/mygallery/site/img/www_libbiking_com_facebook_01.gif" />
<meta property="og:site_name" content="Libbi King" />
<meta property="fb:admins" content="618598922" />
<meta property="fb:app_id" content="251724341605334" />
<meta property="og:description" content="Illustrator &amp; Set Designer in London | libbi@libbiking.com | tel: 07706 553 288" />

        <div id="fb-root"></div>        
        <script type="text/javascript">
          window.fbAsyncInit = function() {
            FB.init({
              appId      : '251724341605334', // App ID
              channelUrl : '//www.libbiking.com/mygallery/site/libbiking/fb_channel.php', // Channel File
              status     : true, // check login status
              cookie     : true, // enable cookies to allow the server to access the session
              xfbml      : true  // parse XFBML
            });

            // Additional initialization code here
          };

          // Load the SDK Asynchronously
          (function(d){
             var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
             if (d.getElementById(id)) {return;}
             js = d.createElement('script'); js.id = id; js.async = true;
             js.src = "//connect.facebook.net/en_US/all.js";
             ref.parentNode.insertBefore(js, ref);
           }(document));
        </script>

    <fb:like href="http://www.libbiking.com/" send="true" layout="button_count" width="180" show_faces="false" font="segoe ui"></fb:like>

使用 fb_channel.php:

<?php
$cache_expire = 60*60*24*365;
header("Pragma: public");
header("Cache-Control: max-age=".$cache_expire);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');
?>
<script src="//connect.facebook.net/en_US/all.js"></script>

奇怪的是,它现在向 Facebook 页面(而不是网站)显示一个安全的 https URI。发送时返回错误消息:

“我们在发送您的消息时遇到以下错误:由于服务器返回状态代码 200,无法访问https://www.facebook.com/pages/Libbi-King/355311097871934的页面”

我已经通过 Facebook Linter/Debugger 解析了该页面,并且响应代码 200 的 OG 似乎很好。我不确定为什么这会导致错误,因为我的理解是响应代码 200 是一个成功的页面检索。如果我用不正确的 URI 替换按钮 href,则发送按钮实际上可以工作!

我注意到在注册应用程序时,类型描述最近从“网站”更改为“使用 Facebook 登录的网站”。我不知道这是否会导致问题...

4

0 回答 0