tekrar merhaba,
- öncelikle uygulamanın verdiği token değil, login sonrası geri dönen access_token aldım ve o sorun kalktı.
- ancak veriyi post etmem hala mümkün değil
- pes etmeme çeyrek kaldı
koum şudur :
<?php
function postToFacebook($message, $link, $picture, $name, $caption, $description, $feedID)
{
// require Facebook PHP SDK
// see: https://developers.facebook.com/docs/php/gettingstarted/
require_once($_DOCUMENT['ROOT']."/APIs/facebook.php");
// initialize Facebook class using your own Facebook App credentials
$config = array();
$config['appId'] = 'APP ID';
$config['secret'] = 'SECRET';
$config['fileUpload'] = false; // optional
$fb = new Facebook($config);
// These are the values that will create the post on facebook
$params = array(
"access_token" => "Your access token", // get an access token here - https://developers.facebook.com/docs/facebook-login/access-tokens/
"message" => $message,
"link" => $link,
"picture" => $picture,
"name" => $name,
"caption" => $caption,
"description" => $description
);
// Attempt to post the article to facebook. The catch will return any error messages, these messages are very easy to understand which makes debugging a charm.
try
{
$ret = $fb->api('/'.$feedID.'/feed', 'POST', $params);
return 'Post successfully published to Facebook!';
}
catch(Exception $e)
{
return $e->getMessage();
}
}
?> edit :
App Security Checkup Sonuçlarım :