I have integrated the offline wall posting for the users of my website who have linked their FB accounts with there user details. I have stored there FB-id, FB-Access token in my database and by using the PHP-SDK libraries I had integrated the feed wall posting in the website. Everything worked very well with all users getting the messages on there facebook wall. But today all the things went in vain as it throws various kinds of error. I have been searching for more documents but can't find the exact relevant solution for this issues.
Lines of code i have used for FB-Wall Posting
$attachment = array(
'access_token' => $accestoken,
'message' => "myTaste || real restaurant reviews, share your taste on myTaste",
'name' => "My Favorite Restaurant is ".$business['name'].$business['location']['city']."-What is yours? ",
'link' => $business['personal_url'],
'description' => "",
Uncaught OAuthException: Error validating access token: Session has expired at unix time
Uncaught OAuthException: (#210) User not visible thrown in /hsphere/local/home/mysite.com/include/3rdparty/facebook-php-sdk/src/facebook.php
Once you grant the
publish_stream permission, no need for the
access_token. So removing it and using something like this would work even without a valid session (just an example):
$params = array( 'message' => "Test Message", 'picture'=> "http://path/to/image.jpg" ); $post_id = $facebook->api("/$uid/feed", "post",$params);
For more information refer to this answer (EDIT 4). Kudos to @zerkms for this info btw!