关于主要功能:
$bpath=realpath(dirname(__FILE__));
require_once $bpath.'/vendors/facebook-php-sdk-master/src/facebook.php';
$fbPermissions = 'publish_stream,manage_pages';
$config=array(
'appId'=>'appid',
'secret'=>'secret'
);
$facebook = new Facebook($config);
$access_token='someaccesstoken';
$facebook->setAccessToken($access_token);
$params=array('message' => 'testing facebook SDK');
$facebook->api('/me/feed','post',$params);
关于登录功能:
$bpath=realpath(dirname(__FILE__));
require_once $bpath.'/vendors/facebook-php-sdk-master/src/facebook.php';
$fbPermissions = 'publish_stream,manage_pages';
$config=array(
'appId'=>'appid',
'secret'=>'secret'
);
$facebook = new Facebook($config);
$fbUser=$facebook->getUser();
$accesstoken=$facebook->getAccessToken();