How to post to a user's wall at a later date - facebook

I'm trying to figure out how, after a user has opted into my Facebook Application, to retain their credentials so as to post to their wall at a later time. I see apps doing this all the time, but I'm unclear where/how they store the user's login (I'm guessing they're not actually holding on to U/P but rather just have some key to post to the user's wall), and then do the post at some later time.
I'm unable to find the documentation for how to do this at the facebook developer site and am hoping someone can point me in the right direction.
TIA

Ask for publish_stream permissions then post to that user's wall using your "app" access token if the user access token has expired.
Facebook documentation here: http://developers.facebook.com/docs/reference/api/permissions/
publish_stream
Enables your app to post content, comments, and likes to a user's
stream and to the streams of the user's friends. With this permission,
you can publish content to a user's feed at any time. However, please
note that Facebook recommends a user-initiated sharing model.

Related

What are my options in terms of posting on a user's friend's wall, on behalf of either the user or my app?

I have an app that a user signs up for that needs to then notify a friend of said user about an upcoming event.
I'm trying to figure out what my options are for how to make this work. In an ideal world, my app would would be able to post to the friend's wall with a custom message (written by the user) at some predetermined time in the future. However, I'm not seeing anything in the API for posting on behalf of a user to one of their friend's walls, so, I'm open to suggestion.
TIA
You can post to a user's friend's feed using the Graph API, assuming the user granted you the relevant (publish_stream) permissions.
POST /[friend]/feed
message=hello...
Users generally consider this very spammy behavior for apps, and so it is not particularly recommended.
Source: https://developers.facebook.com/docs/reference/api/post/

Post on a company facebook page wall on behalf of a user

I have a wp7 app that connect with facebook and lets assume i have the users access token
I am wondering if it is possible to write on the wall of some company facebook page as the user. (i have no ownership of the facebook page and not affiliated with it in any way)
If it is, do you know which permission do i need to obtain ? would love to get any kind of code snippet or a direction i should follow.
Thanks.
it's not possible to write on the wall on behave of the user. You always get a token in the context of a Facebook application - so it will be the app posting on the wall, not the user. And the maximum permission app can ask a user for is publish_stream which allows you (your app actually) to:
Enables your app to post content, comments, and likes to a user's
stream and to the streams of the user's friends.
so in order to post to the company wall, you need to:
Request publish_stream permission from the user
Issue a post request to https://graph.facebook.com/<>/feed url with your message
It's really easy to test. Go to https://developers.facebook.com/tools/explorer, click on "Get access token", select "publish_stream" permission in "Extended" tab, set action to POST, enter "LGUSA/feed" into URL field, click on "Add a field", enter "message: test" and click POST. You will get ID of your post back. See screenshot attached
Sorry this is going to be a bit vauge, but here goes:
First the user is going to have to be authenticated to facebook. There is a good example here. This will give you an authentication tolken to allow you to interact with the API.
The user is going to need facebook permissions to write to the wall. Facebook permissions are described here. I don't know about the specifics of your problem, but with more details I may be able to help more.
then you shoud be able to post to the appropiate wall using the facebook graph api (you'll probably need to be signed up to facebook with a developer account to get to this page).

Facebook privilages for getting messages from wall

I created simple facebook app which asks user for user_about_me, user_activites and user_status privilages. Now I want to get all my wall posts, so I make a request and receive only some of my profile data, but without wall posts. I noticed that my access_token is different from the one I can get in documentation: https://developers.facebook.com/docs/reference/api/.
What should I change?
You need read_stream permission.
http://developers.facebook.com/docs/reference/api/permissions/
read_stream Provides access to all the posts in the user's News Feed and
enables your application to perform searches against the user's
News Feed

Was my Facebook wall POST successful?

I can post on my friends wall after authenticating the Facebook Graph Explorer (or any app with publish_stream permission for that matter).
Facebook Graph Explorer
However, how can I validate in my app that the message has actually posted successfully to my friends wall? In some cases, I can go to my friends page and see my message appear, however, in other cases, I notice that there is no message on their wall.
In either case, Facebook returns an object id, like:
100002349949136_184284371659893
Yet, when I view these posts on the graph (link above), they both return false... The rules of my app require that a message is posted on another user's wall.
How can I validate that a message appears on a Facebook wall? Or how can I filter user's who have restricted 3rd party apps from posting on their walls?
The post must be publicly viewable if you're attempting to read the post without an app access token. If it is not publicly viewable, then you must have read_stream permission set in the app you're attempting to read the post with.
Here is the documentation. https://developers.facebook.com/docs/reference/api/post/

Get facebook post made by my application and the number of likes/comments on it

I have a facebook application that I use to post messages on user's wall. I save the post id. I want to know the number of likes and comments on each of these posts?
Do I need a read_stream permission to access my own posts?
What is the best way to do this?
You will need read_stream permission from the user to be able to read the post since the user owns their own status update (and its likes/comments), not your application. If you have read_stream, you can then just access /postID via the Graph API.