Search code examples
javascriptfacebookfbmlfbjs

facebook api :: how to get the user ID with FBJS & FBML?


how to get the user ID with FBJS & FBML ?

thanks a lot


Solution

  • Use This: First define your constants and:

       $config = array(
                'appId'  => APP_ID,
                'secret' => APP_SECRET,
                'domain' => DOMAIN,
                'cookie' => true
                    );
        $facebook = new Facebook($config);
        $uid = $facebook ->getUser();
        $me = $facebook ->api('/me');
    

    Please see the facebook.php class for functions and arguments. Very good and detailed tutorials are here