I'm trying to publish a feed to my users' Facebook wall. I use Facebook Connect for my site. I have generated the link with getLoginUrl()
with email, offline_access and publish_stream permissions.
My users' click on this link, authenticate with facebook and comes back to my site. When they do, i'm getting their's ID with getUser()
.
Then i'm trying to publish a post to their walls. I use this:
$user = $facebook->getUser();
try {
$publishStream = $facebook->api("/$user/feed", 'post', array(
'message' => "Mesaj icerigi",
'link' => 'http://ithinkdiff.net',
'picture' => 'http://thinkdiff.net/ithinkdiff.png',
'name' => 'iOS Apps & Games',
'description'=> 'Checkout iOS apps and games from iThinkdiff.net. I found some of them are just awesome!'
)
);
} catch (FacebookApiException $e) {
print_r($e);
}
But everytime i try to that, i got an error. Api exception or something. What i'm doing wrong?