在Facebook页面选项卡内使用JavaScript SDK时出现FB.login错误

在Facebook页面选项卡内使用JavaScript SDK时出现FB.login错误,javascript,ruby-on-rails,oauth,facebook-page,facebook-javascript-sdk,Javascript,Ruby On Rails,Oauth,Facebook Page,Facebook Javascript Sdk,我正试图在页面标签应用程序中使用JavaScript SDK来实现共享和其他目的 我在FB.init之后调用FB.login,但弹出窗口中出现以下错误: 发生了一个错误。请稍后再试 这在开发过程中以及我部署到Heroku时都会发生,这是一个Rails 3应用程序 可以,但以下是相关代码: <body> <div id='fb-root'></div> <div id='welcome_header'> <h1&g

我正试图在页面标签应用程序中使用JavaScript SDK来实现共享和其他目的

我在FB.init之后调用FB.login,但弹出窗口中出现以下错误: 发生了一个错误。请稍后再试

这在开发过程中以及我部署到Heroku时都会发生,这是一个Rails 3应用程序

可以,但以下是相关代码:

<body>
    <div id='fb-root'></div>

    <div id='welcome_header'>
      <h1>Coupons</h1>
    </div>
    <h2>Sorry, no active coupons at this time.</h2>
    <h3>
      Sign up to receive future coupons from
      Ed's Coffee &amp; Deli
    </h3>
    <div id='form_section'>
      <form accept-charset="UTF-8" action="/fb/1/subscribers" class="new_subscriber" data-remote="true" id="new_subscriber" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="W3tWnguGrIMRJVXh23K6jTxmOH+QbeJZSD5CUnGf7bg=" /></div>
        <input id="subscriber_email" name="subscriber[email]" placeholder="enter email" size="30" type="text" />
        <input class="btn small btn-primary" name="commit" type="submit" value="GO" />
      </form>
    </div>
    <script>
      //<![CDATA[
        window.fbAsyncInit = function() {
          FB.init({
            appId      : '179754758810880', // App ID
            channelUrl : '//localhost:5000/channel.html', // Channel File
            status     : true, // check login status
            cookie     : true, // enable cookies to allow the server to access the session
            oauth      : true  // parse XFBML
          });    
          // Login
          FB.login(
            function(response) {
              console.log(response);
            },
            { scope: 'publish_actions' }
          );
        };
        // 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>
  </body>

知道为什么会这样吗?JSSDK可以在页面选项卡中使用吗

我不想回答我自己的问题,但我能解决这个问题

在应用程序设置中,我没有在集成选项下检查网站。我认为,因为它被设置为一个页面选项卡,所以这是没有必要的。但事实确实如此


对不起,没人及时回答你的问题,我其实知道这个问题。你能把这个标记为可接受的答案吗?