I have a facebook application and i want to post a message from the application directly to the wall by calling a php script from my flex application.
Can you please help me out.
function postmessage($appid) {
$facebook = new Facebook(array(
'appId' => 'XXX',
'secret' => 'xxx',
'cookie' => true
));
$session = $facebook->getSession();
$attachment = array(
'message' => 'this is my message',
'name' => 'This',
'caption' => 'Caption of the Post',
'link' => 'apps.facebook.com/tvtreasurehunt/',
'description' => 'this is a description'
);
$result = $facebook->api('/me/feed/', 'post', $attachment);
}
The following code creates a post on the user’s wall. Prerequisite: you need to have a valid access_token with publish_stream permission.
For more detailed information see the official documentation: Post on Facebook Developers.