Facebook: Comment to User's post using my facebook app's page - facebook

I'm developing a Facebook app where the app post a picture to user's wall after the user grant required permissions.
However according to Facebook's privacy policy they don't allow our facebook apps to post anything to user's wall which haven't explicitly entered by the user(neither as the text of the post nor as a comment to that same post).
But I need to let the people who see the post on user's wall to know where the user got it from(a link preferably).
So is there a way to post a comment to the generated post in the user's wall as my facebook app's page??(So that the comment is not posted by the user and does not violate facebook's policy)
Grateful for any help.

Related

Is it possible to post on other user wall from my account using facebook api's

I have a requirement where i need to post to my webapp user's fb wall from my webapp fb account(After asking user permission). I have seen other examples where webapp post to the user's wall on behalf of user. In my case instead of posting on behalf of user i have to post from webapp fb account to user wall.
Is this case possible? If possible please provide me the details.
Thanks.
As of February 6, 2013 Facebook has depreciated the feature to post to Friends wall. The same was announced in this blog post.
If you want to allow people to post to their friend’s timeline from your app, you can invoke the feed dialog.

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).

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

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.

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/

Posting to a business page from outside facebook?

As the title says, I'm trying to create a web page that allows admins to post to a facebook page, not a profile. How do I go about doing this? I can easily post to my profile wall, but I can't seem to find anything on posting to the business page wall.
It's the exact same process to post to a Facebook Page's Wall, but you need to use the Page's ID and not the user's:
POST to:
https://graph.facebook.com/{page_id}/feed
POST BODY:
access_token={access_token}&message=Hello
Make sure you have the "publish_stream" permission from the user.