2

I am creating an fb app , I just want to navigate to next page if the user already liked my page and for not liked user only onclick of like it will go to the next page . this code is working fine for my account but not for others . Can you please help me out .

 <div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '657165490961669', 
      channelUrl : 'https://www.facebook.com/cypiyow', 
      status     : true, 
      cookie     : true, 
      xfbml      : true  
    });

    FB.getLoginStatus(function(response) {
      var page_id = "228530813943529";
      if (response && response.authResponse) {
        var user_id = response.authResponse.userID;
        var fql_query = "SELECT uid FROM page_fan WHERE page_id = "+page_id+"and uid="+user_id;
        FB.Data.query(fql_query).wait(function(rows) {
          if (rows.length == 1 && rows[0].uid == user_id) {
        window.location = "email_form.php";
          } else {
    FB.Event.subscribe('edge.create',
        function(response) {
            window.location = "email_form.php"; 
        }
    );

          }
        });
      } else {
            //error message 
      }
    });
  };

  (function(d){
    var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    d.getElementsByTagName('head')[0].appendChild(js);
  }(document));
</script>
4

1 回答 1

1

在您的应用程序在 Facebook 开发人员区域的设置中,此应用程序是否处于沙盒模式?这将导致它仅对您可用,如果这就是您说它只对您有用的意思。您需要在应用设置中添加一些测试人员或退出沙盒模式

于 2013-10-19T21:19:57.253 回答