How can i post stream ($facebook->api('/me/feed', 'post', $attachment);
) to my app users on anytime. I think i can get access token via $facebook->getAccessToken();
but after, how can i post to wall?
Asked
Active
Viewed 2,835 times
1
2 Answers
0
Grant the publish_stream
permission and use the user id after that instead of me
:
$facebook->api("/$user_id/feed", 'post', $attachment);
For more information, check the last edit (EDIT 4) on this answer (also follow the discussion on the other answer that I linked to there).
0
First: See if the session is valid
if ($session) {
try {
$uid = $facebook->getUser();
$me = $facebook->api('/me');
Second - IF it is valid, you will make the API call to post
$facebook->api('/me/feed', 'post', array(
'message'=> 'Sample Message',
'picture' => 'URL of Picture',
'link'=> 'URL',
'description'=>'Description',
'name'=> 'Name of Post',
'privacy'=> 'privacy',
'caption'=>'Caption', ) );
} catch (FacebookApiException $e) {
error_log($e);
}
}
It's simple, just copy all the code you see above, it should work out the box.

Brandon Bissoon
- 131
- 5