난 내 자신의 벽에 게시하기 전에 인증해야하는 것은 내 코드는 페이스 북 응용 프로그램 인증 - 그래서 여기, PHP
function get_app_token($appid, $appsecret)
{
$args = array(
'grant_type' => 'client_credentials',
'client_id' => $appid,
'client_secret' => $appsecret
);
$ch = curl_init();
$url = 'https://graph.facebook.com/oauth/access_token';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$data = curl_exec($ch);
return json_encode($data);
}
$token = get_app_token($appid, $appsecret);
$attachment = array('message' => '',
'access_token' => $token,
'name' => 'Attachment Name',
'caption' => 'Attachment Caption',
'link' => 'http://apps.facebook.com/xxxxxx/',
'description' => 'Description .....',
'picture' => 'http://www.google.com/logo.jpg',
'actions' => array(array('name' => 'Action Text',
'link' => 'http://apps.facebook.com/xxxxxx/'))
);
$result = $facebook->api('/me/feed/', 'post', $attachment);
내가 오류 OAuthException , 잘못된 OAuth 액세스 토큰 서명을 받고 있습니다.
가능한 중복 (http://stackoverflow.com/questions/5126665/need- help-on-post-on-user-wall) – ifaour
위에서 게시 한 링크를 통해 시작할 수 있습니다. "응용 프로그램 액세스 토큰"을 요청하고 있습니다! 이것은 사용자를 대신하여 작업을 수행하는 데 사용되지 않습니다! – ifaour