开发者

Trouble with profile details

开发者 https://www.devze.com 2023-01-31 02:52 出处:网络
I what to develop a FBML internal applica开发者_Go百科tion. I used: require \'facebook.php\';$appId =\'xxx\';$secret =\'xyx\';$facebook = new Facebook(array( \'appId\'=> $appId,\'secret\' => $s

I what to develop a FBML internal applica开发者_Go百科tion. I used:

require 'facebook.php';$appId ='xxx';$secret ='xyx';$facebook = new Facebook(array( 'appId'  => $appId,  'secret' => $secret,  'cookie' => true,)); $session = $facebook->getSession();

But I can not get the profile data of the user logged in..uid,name, etc...

Where I get it wrong?


You need to respond to the user login attempt and also retrieve the cookie...

//attach this below your current code
  FB.Event.subscribe('auth.login', function(response) {
    window.location.reload();
  });

And then also

//somewhere before you load the page...
$cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET);

Check http://developers.facebook.com/docs/authentication/ and look at Single Sign On with Javascript SDK

0

精彩评论

暂无评论...
验证码 换一张
取 消