I want to post to my own application wall a text with a script but without to login first because it should be done automatically. How could I do that? I tried already:
$fb = new Facebook(array(
'appId' => 'appid',
'secret' => 'appsecret',
'cookie' => true
));
if ($fb->getSession()) {
// Post
} else {
// Logger
// Every time I get in here :(
}
What do I have to do to get the access to post to my the own app wall with a script?
If you want to post to your own Application wall, all you need is an application Access Token, and if you want to publish to an user wall without login, you also need this user long live access token, for that you have to ask for Offline access permission.
To publish to your application wall :
1- Curl this link to get your application access token :
https://graph.facebook.com/oauth/access_token? client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET& grant_type=client_credentials
2- Publish to wall without checking for the session
Example :
Check APP LOGIN part in this page for more informations : http://developers.facebook.com/docs/authentication/
I cant leave this as a comment as I dont have the points, but if any one has a similar issue - if McSharks answer doesnt work, remove the json_encode as its encoding quotation marks and it should work.