Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook开放图故事未登录两次就无法发布_Facebook_Facebook Graph Api_Facebook Opengraph - Fatal编程技术网

Facebook开放图故事未登录两次就无法发布

Facebook开放图故事未登录两次就无法发布,facebook,facebook-graph-api,facebook-opengraph,Facebook,Facebook Graph Api,Facebook Opengraph,我正试图发表一篇开放的图表故事。我面临的问题是,用户必须登录两次才能发布一篇文章。我已经用开发人员的帐户和测试用户的帐户进行了尝试。当我单击“登录”按钮时,我登录了,但没有发布任何故事,然后我再次单击“登录”按钮,然后我得到了肯定的响应,并且发布了一个故事,可以在我的活动日志中看到。我真的不知道我做错了什么,在这里发布之前我已经搜索了很多。我们将非常感谢在这方面提供的任何帮助 链接至我的考试网站:- 我的HTML文件如下所示 <!DOCTYPE html> <html>

我正试图发表一篇开放的图表故事。我面临的问题是,用户必须登录两次才能发布一篇文章。我已经用开发人员的帐户和测试用户的帐户进行了尝试。当我单击“登录”按钮时,我登录了,但没有发布任何故事,然后我再次单击“登录”按钮,然后我得到了肯定的响应,并且发布了一个故事,可以在我的活动日志中看到。我真的不知道我做错了什么,在这里发布之前我已经搜索了很多。我们将非常感谢在这方面提供的任何帮助

链接至我的考试网站:-

我的HTML文件如下所示

<!DOCTYPE html>
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# funtemple: http://ogp.me/ns/fb/funtemple#">
  <meta property="fb:app_id" content="Hidden" /> 
  <meta property="og:type"   content="funtemple:board" /> 
  <meta property="og:url"    content="http://funtemple.net/index.html" /> 
  <meta property="og:title"  content="Sample Board" /> 
  <meta property="og:image"  content="https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png" /> 

<link rel="stylesheet" href="hello.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<title>Open Graph Getting Started App - og.likes</title>
<style type="text/css">
div { padding: 10px; }
</style>
<meta charset="UTF-8">
</head>
<body>
 <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'Hidden',
          xfbml      : true,
          version    : 'v2.0'
        });
      };

      (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/en_US/sdk.js";
         fjs.parentNode.insertBefore(js, fjs);
       }(document, 'script', 'facebook-jssdk'));
    </script>

<header>
        Welcome to the message board app
    </header>
        <h1 class ="headingName">Hello </h1>

        <button class = 'loginButton'> Press me to Login </button>

        <br>
        <br>
        <br>

        <div class="message">
        <h5>Warning</h5>
        </div>

        <br>
        <br>
        <br>
        <br>

        <div class="message2">
        <h5>Important Info</h5>
        </div>

    <footer>
    </footer>

<script src="hello.js"> </script>

</body>
</html>
$('.loginButton').click(function(){

 // FACEBOOK LOGIN
   FB.login(function(response) {


 // GETTING FACEBOOK DATA

      FB.api('/me', function(response) {

        // stuff you want to happen after getting data goes here
     // alert(response.name);
       //console.log(response);

      $(".headingName").append(response.name);

      }); //FB.api

      // END - FACEBOOK DATA

 },{scope: 'publish_actions'}); //FB.login

   // END - FACEBOOK LOGIN

}); //click

$('.message').click(function(){

 FB.getLoginStatus(

 function(response){
 //alert(response.status);
if(response.status=="connected")
{

FB.api(
  'me/funtemple:view',
  'post',
  {
    board: "http://funtemple.net/index.html"
  },
  function(response) {

  if(!response || response.error){
  alert(JSON.stringify(response.error));
  alert('Error Occurred' + response.responseText + " " + response.error.responseText);

  } 
  else{

  alert('Action was successful! Action ID:' + response.id);

}

  }
);



 window.open('http://funtemple.net/warning.html',' mywindow ',' width=400 ,height=200' );
}

else{
 alert("Please Login to use the message board");

}

}
);

}); //click

$('.message2').click(function(){

 alert('Hello2');

}); //click