Post to facebook wall without logging in
I want to post messages, links, etc. into facebook wall without 开发者_如何学JAVAlogging in.
For example, I have a blog site, when I submit/post a blog, the url for that blog will automatically post on facebook.
Is this possible?
This is indeed possible, as long as you have a valid authorization token to use with Facebook (this means, it is not possible if the user hasn't authorized your application). For this, though, you require "offline_access" within the token's permissions. More about the topic on Facebook's documentation.
Please note that this behavior is not exactly... uhm, encouraged by Facebook, thus there isn't much documentation on how to do it. You should also remember that you must have a way to store your access token, since requesting it again would require user input, as well as some kind of way to get one again, for it expires after some time (it is long-lived, though).
Eventhough great answer given already I would share this post: http://eagerfish.eu/using-facebook-off-line-access-to-post-on-users-wall/. It is short explanation how to post on your/others wall without signing in. It uses offline_access permission pointed out earlier.
Both answers are a bit misleading!
You don't need the offline_access
permission to post content to Facebook. Only the publish_stream
permission is needed.
Even if no user login is required. Once the user authorize your app with the publish_stream
permission, you can start posting content on his behalf without the need of him to login!
I described this here. I'll expand the post to provide a more complete code soon.
Both of these permissions
offline_access
and publish_streams
have been removed,
link here
https://developers.facebook.com/docs/roadmap/completed-changes/offline-access-removal/
精彩评论