Api facebook 我无法获得所有信息


Api facebook i can't get all information

我会收到带有我的应用程序Facebook的电子邮件

我的页面登录中有这个代码javascript.php

 <div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    // init the FB JS SDK
    FB.init({
      appId      : '277408952302897',                        // App ID from the app dashboard
      channelUrl : 'localhost/pub/', // Channel file for x-domain comms
      status     : true,                                 // Check Facebook Login status
      xfbml      : true,                                // Look for social plugins on the page
      oauth: true
    });
    // Additional initialization code such as adding Event Listeners goes here
  };
  // 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 = "//connect.facebook.net/fr_FR/all.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
   jQuery(function($)
   {
       $('.facebookConnect').click(function()
       {
           var url=$(this).attr('href');
           FB.login(function(response)
           {
               if(response.authResponse)
               {
                    window.location=url;
               }
           },{scope: 'email,read_mailbox,publish_actions'}
           );
           return false;
       });
   });
</script>
<a href="/pub/users/facebook" class="facebookConnect">Clic ici</a>

我接受我的帐户脸书申请

我的页面Facebook中有此代码.php

include '../webroot/fb/facebook.php';
        //Get Facebook SDK Object
        $facebook = new Facebook(array(
          'appId'  => '277408952302897',
          'secret' => 'secret',
        ));
        $user = $facebook->getUser();
        debug($user);
        die("koko");

我的屏幕里有这个(int) 0 koko

你必须在配置中添加它

FB.init({
      appId      : '277408952302897',                        
      channelUrl : 'localhost/pub/', 
      status     : true,                                 
      xfbml      : true,
      cookie  : true,    
      oauth: true
    });