Facebook post on timeline - facebook

Twitter has a very simple API for encouraging users to tweet something based on web intents. See here.
Does Facebook have an equivalent? If so, what is it? What I basically need is to let users be able to post a message from my website to either their timeline or a friend's timeline, with facebook itself handling the login authentication stuff. So the use cases would be: 1) user clicks the post link, happens to be logged into FB on his browser, and FB takes them to their timeline with the text already pasted into their status update box; or 2) same as 1, but with an intermediary log in step for a user who didn't happen to be logged in before.
If anyone has any ideas, please let me know!
Thanks.

Related

How to get Facebook Post Like, Comment and Share action from user

I stumbled into a facebook post where when user click the like button, or share the post or post a comment, a facebook page bot will automatically message the user. Here is the exact post:
https://www.facebook.com/ninjateam.org/posts/1799394500352455
I'm trying to look into the facebook developers API documentation on how to do those kind of functionality but always failed. Can you point me to the correct path where to start or what resource is used in those kind or post?

Does Facebook send notifications to my web page by the fb app?

I have searched on Google and Fb's documentation about this but didn't find anything.
I've already shared content of my page on Facebook with the Share button provided by FB's api and also made an app on Facebook.
Now I want to receive notifications in my page when someone comments the publication or likes it.
I know that I can consult the posts/comments/likes if the user gives me the permissions, but I don't want to do this every 5 minutes. I want that facebook notifies me like a push notification.
How can I do that if it's possible?
Thanks!
After the user shared something on his wall, there is no way for you to get notified about comments/likes on that wall post, unless you authorize the user with user_status or read_stream.
That being said, there is the Realtime API with the feed and statuses fields to subscribe to: https://developers.facebook.com/docs/graph-api/real-time-updates/
That´s probably the best option, although you must authorize the user with the correct permissions too.

Graph API 'likes', publish_stream permission, app unapproved

I have a website that does the following:
Retrieve Facebook Page posts from a specific Page.
Display posts on website.
If a visitor is not logged in to Facebook, display a custom 'log in with Facebook' button next to each post. Otherwise display a custom 'thumbs up' button.
By clicking the 'thumbs up' button, the user is able to like the specific Facebook page post with their own Facebook account. Nothing should show on the user's timeline other than the regular posts that Facebook displays whenever a user likes something on Facebook.
I'm using the Graph API likes method (https://developers.facebook.com/docs/graph-api/reference/v2.2/object/likes/) which requires the publish_actions permission.
Everything is working great, users are able to like posts on the Facebook page from the website, and the action shows up in their Activity Log.
The problem is the app is rejected for the following reasons:
Notes from our review team (Web)
The expected story doesn't publish back to Facebook. I've tried with different test users to reproduce the publish_actions, but nothing is publishing. Please check links and resubmit. Also provide a timeline screenshot of the publish story. Thank you.
publish_actions (Web)
We could not reproduce the requested permission. Please submit a timeline screenshot of a successful publish on Facebook, as well as detailed, step-by-step English instructions in the "Add Notes" section of the permission.
See here for additional information on login permission requirements.
I've provided step by step instructions, screenshots of the website as well as a screenshot of the user's Activity Log that shows them liking the post. Still no luck.
I think the problem may be that they are expecting some sort of story to be displayed on the user's timeline, which I don't need or want. I just want to let the user like the post from a Facebook page which DOES work and confirmed by everyone who's tested it on my end.
If anyone can point me in the right direction (I'm unable to provide screenshots or code here, sorry), it would be greatly appreciated. Thanks in advance!

How to share a photo on facebook wall from a website?

Hi guys I am working on a project:
the client's goal is to let user simply share the photo on their facebook wall with some fixed message. and the project is simply a website, no login is needed, user will just come to the machine and take a photo and click to share to facebook account, of course user will be required for permission to let my website to access his fb account.
so what should it be? simply the like button? or maybe something more tricky like using the Graph API? I am still reading on it at the moment since I am really new to Facebook. Please give some hint.
By the way I may use wordpress for my backend
Thanks!!
First you will need user to give your app permission to post on the wall, next after the photo is taken you will need to post it on user's wall using Graph API (you can find out how to do that here)

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