2011-02-07 43 views
1

上张贴进我知道如何张贴在墙上的东西$facebook->api('/me/feed/', 'post', $feed); 但如何发布我的Facebook应用程序页面上饲料和这种饲料必须由应用程序发布我的Facebook应用程序的风扇

回答

4

在这里你去:

// we need to get an application access_token first 
$token_url = "https://graph.facebook.com/oauth/access_token?" . 
    "client_id=" . $app_id . 
    "&client_secret=" . $app_secret . 
    "&grant_type=client_credentials"; 
$app_token = file_get_contents($token_url); 

// seperate the string returned to use it in the post array 
$arr = explode("=",$app_token); 
$app_token = $arr[1]; 

$post_id = $facebook->api("/$app_id/feed", "POST", array("access_token"=>$app_token,"message"=>"hello app!")); 
+0

非常感谢这项工作,图api和access_token的概念仍然抽象为我。 – nirvanist 2011-02-07 22:25:09

相关问题