that still doesnt help, like i said i read their docs already + some other guides i found on google in vein.
what does that line needed for?
Code:
$user_id = $facebook->getUser();
I'm posting on facebook page on behalf of my application only, i dont need any users, any authorication or anything related to it.
when i try some different code like this:
Code:
require_once("facebook.php");
$config = array();
$config['appId'] = 'appid';
$config['secret'] = 'appsecret';
$config['fileUpload'] = true;
$facebook = new Facebook($config);
$photo = $facebook->api('/pageID/photos','POST',array('source' => '@img.jpg', 'message' => 'test.'));
it throws me the following error:
Fatal error: Uncaught OAuthException: A user access token is required to request this resource. thrown in base_facebook.php on line 1106
where do i get such a token, is that my session key? where do i put it?
Even in my previous code i gave in first post there are 2 useless lines, the real and very simplified code is this:
Code:
require_once('facebook-platform/php/facebook.php');
try
{
$facebook = new Facebook('app ID', 'secret key');
$facebook->api_client->session_key = 'session key';
$facebook->api_client->stream_publish("some text to post",$attachment,$action_links,'pageID','pageID');
}
catch(Exception $e) {}
Bookmarks